summaryrefslogtreecommitdiff
path: root/spec/factories/todos.rb
blob: f426e27afedddc709c1d40d69a5f82e73abaa207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FactoryGirl.define do
  factory :todo do
    project
    author
    user
    target factory: :issue
    action { Todo::ASSIGNED }

    trait :assigned do
      action { Todo::ASSIGNED }
    end

    trait :mentioned do
      action { Todo::MENTIONED }
    end

    trait :on_commit do
      commit_id RepoHelpers.sample_commit.id
      target_type "Commit"
    end

    trait :build_failed do
      action { Todo::BUILD_FAILED }
    end
  end
end