BigW Consortium Gitlab

todos.rb 612 Bytes
Newer Older
1
FactoryGirl.define do
2
  factory :todo do
3 4 5
    project
    author
    user
6
    target factory: :issue
7
    action { Todo::ASSIGNED }
8

9
    trait :assigned do
10
      action { Todo::ASSIGNED }
11 12
    end

13
    trait :mentioned do
14
      action { Todo::MENTIONED }
15
    end
16 17 18 19 20

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

    trait :build_failed do
      action { Todo::BUILD_FAILED }
24
      target factory: :merge_request
25
    end
26

27 28 29 30
    trait :approval_required do
      action { Todo::APPROVAL_REQUIRED }
    end

31 32 33
    trait :done do
      state :done
    end
34 35
  end
end