BigW Consortium Gitlab

todos.rb 575 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 24

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

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

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