BigW Consortium Gitlab

todos.rb 1000 Bytes
Newer Older
1
FactoryGirl.define do
2
  factory :todo do
3
    project factory: :empty_project
4 5
    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 :directly_addressed do
      action { Todo::DIRECTLY_ADDRESSED }
    end

21 22
    trait :build_failed do
      action { Todo::BUILD_FAILED }
23
      target factory: :merge_request
24
    end
25

Jacopo committed
26 27 28 29
    trait :marked do
      action { Todo::MARKED }
    end

30 31 32 33
    trait :approval_required do
      action { Todo::APPROVAL_REQUIRED }
    end

34 35 36 37
    trait :unmergeable do
      action { Todo::UNMERGEABLE }
    end

38 39 40 41
    trait :pending do
      state :pending
    end

42 43 44
    trait :done do
      state :done
    end
45
  end
46 47 48 49 50 51 52 53 54

  factory :on_commit_todo, class: Todo do
    project factory: :empty_project
    author
    user
    action { Todo::ASSIGNED }
    commit_id RepoHelpers.sample_commit.id
    target_type "Commit"
  end
55
end