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

24 lines
512 B
Ruby
Raw Normal View History

FactoryGirl.define do
2016-09-20 16:07:56 -04:00
factory :label, class: ProjectLabel do
sequence(:title) { |n| "label#{n}" }
color "#990000"
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
end
factory :group_label, class: GroupLabel do
sequence(:title) { |n| "label#{n}" }
color "#990000"
group
end
end