debian-mirror-gitlab/spec/factories/labels.rb
2016-11-03 12:29:30 +05:30

23 lines
488 B
Ruby

FactoryGirl.define do
factory :label, class: ProjectLabel do
sequence(:title) { |n| "label#{n}" }
color "#990000"
project
transient do
priority nil
end
after(:create) do |label, evaluator|
if evaluator.priority
label.priorities.create(project: label.project, priority: evaluator.priority)
end
end
end
factory :group_label, class: GroupLabel do
sequence(:title) { |n| "label#{n}" }
color "#990000"
group
end
end