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

48 lines
850 B
Ruby
Raw Normal View History

FactoryGirl.define do
2016-02-20 08:59:59 -05:00
factory :todo do
project factory: :empty_project
author
user
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 :on_commit do
commit_id RepoHelpers.sample_commit.id
target_type "Commit"
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
2016-03-11 14:04:42 -05:00
trait :done do
state :done
end
end
end