2017-12-14 00:13:44 +00:00
|
|
|
FactoryBot.define do
|
2016-02-20 13:59:59 +00:00
|
|
|
factory :todo do
|
2017-08-02 19:55:11 +00:00
|
|
|
project
|
2018-07-16 13:35:19 +00:00
|
|
|
author { project&.creator || user }
|
|
|
|
user { project&.creator || user }
|
2016-02-18 13:51:53 +00:00
|
|
|
target factory: :issue
|
2016-02-20 13:59:59 +00:00
|
|
|
action { Todo::ASSIGNED }
|
2016-02-16 02:26:33 +00:00
|
|
|
|
2016-02-17 22:04:14 +00:00
|
|
|
trait :assigned do
|
2016-02-20 13:59:59 +00:00
|
|
|
action { Todo::ASSIGNED }
|
2016-02-16 02:26:33 +00:00
|
|
|
end
|
|
|
|
|
2016-02-17 22:04:14 +00:00
|
|
|
trait :mentioned do
|
2016-02-20 13:59:59 +00:00
|
|
|
action { Todo::MENTIONED }
|
2016-02-16 02:26:33 +00:00
|
|
|
end
|
2016-03-16 23:31:30 +00:00
|
|
|
|
2016-12-05 12:12:22 +00:00
|
|
|
trait :directly_addressed do
|
|
|
|
action { Todo::DIRECTLY_ADDRESSED }
|
|
|
|
end
|
|
|
|
|
2016-03-08 18:22:50 +00:00
|
|
|
trait :build_failed do
|
|
|
|
action { Todo::BUILD_FAILED }
|
2016-12-22 13:27:39 +00:00
|
|
|
target factory: :merge_request
|
2016-03-08 18:22:50 +00:00
|
|
|
end
|
2016-03-11 19:04:42 +00:00
|
|
|
|
2017-01-28 22:39:24 +00:00
|
|
|
trait :marked do
|
|
|
|
action { Todo::MARKED }
|
|
|
|
end
|
|
|
|
|
2016-07-11 10:02:11 +00:00
|
|
|
trait :approval_required do
|
|
|
|
action { Todo::APPROVAL_REQUIRED }
|
|
|
|
end
|
|
|
|
|
2016-12-14 14:37:31 +00:00
|
|
|
trait :unmergeable do
|
|
|
|
action { Todo::UNMERGEABLE }
|
|
|
|
end
|
|
|
|
|
2017-01-16 13:11:08 +00:00
|
|
|
trait :pending do
|
|
|
|
state :pending
|
|
|
|
end
|
|
|
|
|
2016-03-11 19:04:42 +00:00
|
|
|
trait :done do
|
|
|
|
state :done
|
|
|
|
end
|
2016-02-15 22:26:30 +00:00
|
|
|
end
|
2017-02-21 13:44:21 +00:00
|
|
|
|
|
|
|
factory :on_commit_todo, class: Todo do
|
2017-08-02 19:55:11 +00:00
|
|
|
project
|
2017-02-21 13:44:21 +00:00
|
|
|
author
|
|
|
|
user
|
|
|
|
action { Todo::ASSIGNED }
|
2018-09-20 17:02:36 +00:00
|
|
|
commit_id { RepoHelpers.sample_commit.id }
|
2017-02-21 13:44:21 +00:00
|
|
|
target_type "Commit"
|
|
|
|
end
|
2016-02-15 22:26:30 +00:00
|
|
|
end
|