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

41 lines
836 B
Ruby
Raw Normal View History

# == Schema Information
#
2016-02-20 08:59:59 -05:00
# Table name: todos
#
# id :integer not null, primary key
# user_id :integer not null
# project_id :integer not null
# target_id :integer
# target_type :string not null
# author_id :integer
2016-02-18 08:51:53 -05:00
# action :integer not null
# state :string not null
# created_at :datetime
# updated_at :datetime
# note_id :integer
# commit_id :string
#
FactoryGirl.define do
2016-02-20 08:59:59 -05:00
factory :todo do
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 :on_commit do
commit_id RepoHelpers.sample_commit.id
target_type "Commit"
end
end
end