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