docbrown/spec/factories/reactions.rb
Jacob Herrington f388fb46e9
Handle negative reactions on comments (#7805)
It totally slipped my mind that we can create negative reactions on
comments. This PR accounts for that in the internal view that renders
negative reactions.
2020-05-13 09:27:38 -04:00

37 lines
781 B
Ruby

FactoryBot.define do
factory :reaction do
user
association :reactable, factory: :article
category { "like" }
end
factory :reading_reaction, class: "Reaction" do
user
association :reactable, factory: :article
category { "readinglist" }
end
factory :thumbsdown_reaction, class: "Reaction" do
user
association :reactable, factory: :article
category { "thumbsdown" }
trait :user do
association :reactable, factory: :user
end
end
factory :vomit_reaction, class: "Reaction" do
user
association :reactable, factory: :article
category { "vomit" }
trait :user do
association :reactable, factory: :user
end
trait :comment do
association :reactable, factory: :comment
end
end
end