2014-07-29 10:10:15 -04:00
|
|
|
FactoryGirl.define do
|
2016-09-20 16:07:56 -04:00
|
|
|
factory :label, class: ProjectLabel do
|
2016-03-01 11:33:13 -05:00
|
|
|
sequence(:title) { |n| "label#{n}" }
|
2014-07-29 10:10:15 -04:00
|
|
|
color "#990000"
|
2017-01-24 20:30:56 -05:00
|
|
|
project factory: :empty_project
|
2016-10-14 19:06:26 -04:00
|
|
|
|
|
|
|
transient do
|
|
|
|
priority nil
|
|
|
|
end
|
|
|
|
|
|
|
|
after(:create) do |label, evaluator|
|
|
|
|
if evaluator.priority
|
|
|
|
label.priorities.create(project: label.project, priority: evaluator.priority)
|
|
|
|
end
|
|
|
|
end
|
2014-07-29 10:10:15 -04:00
|
|
|
end
|
2016-09-21 16:47:58 -04:00
|
|
|
|
|
|
|
factory :group_label, class: GroupLabel do
|
|
|
|
sequence(:title) { |n| "label#{n}" }
|
|
|
|
color "#990000"
|
|
|
|
group
|
|
|
|
end
|
2014-07-29 10:10:15 -04:00
|
|
|
end
|