debian-mirror-gitlab/spec/factories/todos.rb

56 lines
1,000 B
Ruby
Raw Normal View History

2016-04-02 18:10:28 +05:30
FactoryGirl.define do
factory :todo do
2017-08-17 22:00:37 +05:30
project factory: :empty_project
2016-04-02 18:10:28 +05:30
author
user
target factory: :issue
action { Todo::ASSIGNED }
trait :assigned do
action { Todo::ASSIGNED }
end
trait :mentioned do
action { Todo::MENTIONED }
end
2016-06-02 11:05:42 +05:30
2017-08-17 22:00:37 +05:30
trait :directly_addressed do
action { Todo::DIRECTLY_ADDRESSED }
2016-06-02 11:05:42 +05:30
end
trait :build_failed do
action { Todo::BUILD_FAILED }
2017-08-17 22:00:37 +05:30
target factory: :merge_request
end
trait :marked do
action { Todo::MARKED }
2016-06-02 11:05:42 +05:30
end
2016-08-24 12:49:21 +05:30
trait :approval_required do
action { Todo::APPROVAL_REQUIRED }
end
2017-08-17 22:00:37 +05:30
trait :unmergeable do
action { Todo::UNMERGEABLE }
end
trait :pending do
state :pending
end
2016-08-24 12:49:21 +05:30
trait :done do
state :done
end
2016-04-02 18:10:28 +05:30
end
2017-08-17 22:00:37 +05:30
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
2016-04-02 18:10:28 +05:30
end