gitlab-org--gitlab-foss/spec/factories/todos.rb

56 lines
991 B
Ruby
Raw Normal View History

FactoryBot.define do
2016-02-20 08:59:59 -05:00
factory :todo do
project
author { project.creator }
user { project.creator }
2016-02-18 08:51:53 -05:00
target factory: :issue
2016-02-20 08:59:59 -05:00
action { Todo::ASSIGNED }
trait :assigned do
2016-02-20 08:59:59 -05:00
action { Todo::ASSIGNED }
end
trait :mentioned do
2016-02-20 08:59:59 -05:00
action { Todo::MENTIONED }
end
trait :directly_addressed do
action { Todo::DIRECTLY_ADDRESSED }
end
trait :build_failed do
action { Todo::BUILD_FAILED }
2016-12-22 08:27:39 -05:00
target factory: :merge_request
end
2016-03-11 14:04:42 -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
trait :unmergeable do
action { Todo::UNMERGEABLE }
end
trait :pending do
state :pending
end
2016-03-11 14:04:42 -05:00
trait :done do
state :done
end
end
factory :on_commit_todo, class: Todo do
project
author
user
action { Todo::ASSIGNED }
commit_id RepoHelpers.sample_commit.id
target_type "Commit"
end
end