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

35 lines
575 B
Ruby
Raw Normal View History

FactoryGirl.define do
2016-02-20 13:59:59 +00:00
factory :todo do
project
author
user
2016-02-18 13:51:53 +00:00
target factory: :issue
2016-02-20 13:59:59 +00:00
action { Todo::ASSIGNED }
trait :assigned do
2016-02-20 13:59:59 +00:00
action { Todo::ASSIGNED }
end
trait :mentioned do
2016-02-20 13:59:59 +00:00
action { Todo::MENTIONED }
end
trait :on_commit do
commit_id RepoHelpers.sample_commit.id
target_type "Commit"
end
trait :build_failed do
action { Todo::BUILD_FAILED }
end
2016-03-11 19:04:42 +00:00
2016-07-11 10:02:11 +00:00
trait :approval_required do
action { Todo::APPROVAL_REQUIRED }
end
2016-03-11 19:04:42 +00:00
trait :done do
state :done
end
end
end