Welcome to mirror list, hosted at ThFree Co, Russian Federation.

todos.rb « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 91d6f39a5bf3f578bc541cf9b0bad45823172496 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
FactoryGirl.define do
  factory :todo do
    project factory: :empty_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 }
      target factory: :merge_request
    end

    trait :approval_required do
      action { Todo::APPROVAL_REQUIRED }
    end

    trait :unmergeable do
      action { Todo::UNMERGEABLE }
    end

    trait :done do
      state :done
    end
  end
end