2014-07-29 10:10:15 -04:00
|
|
|
FactoryGirl.define do
|
2017-03-24 14:12:22 -04:00
|
|
|
trait :base_label do
|
|
|
|
title { generate(:label_title) }
|
2014-07-29 10:10:15 -04:00
|
|
|
color "#990000"
|
2017-03-24 14:12:22 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
factory :label, traits: [:base_label], class: ProjectLabel do
|
2017-08-02 15:55:11 -04:00
|
|
|
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
|
|
|
|
2017-03-24 14:12:22 -04:00
|
|
|
factory :group_label, traits: [:base_label] do
|
2016-09-21 16:47:58 -04:00
|
|
|
group
|
|
|
|
end
|
2014-07-29 10:10:15 -04:00
|
|
|
end
|