summaryrefslogtreecommitdiff
path: root/spec/factories/award_emoji.rb
blob: a430210ab49a374ad38187ca34a3b5b8bb082ec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

FactoryBot.define do
  factory :award_emoji do
    name { "thumbsup" }
    user
    awardable factory: :issue

    after(:create) do |award, evaluator|
      award.awardable.project&.add_guest(evaluator.user)
    end

    trait :upvote
    trait :downvote do
      name { "thumbsdown" }
    end
  end
end