gitlab-org--gitlab-foss/spec/factories/labels.rb
Rémy Coutable 58fe40fbd3 Don't use FFaker in factories, use sequences instead
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-03 18:54:48 +02:00

24 lines
504 B
Ruby

FactoryGirl.define do
trait :base_label do
title { generate(:label_title) }
color "#990000"
end
factory :label, traits: [:base_label], class: ProjectLabel do
project factory: :empty_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, traits: [:base_label] do
group
end
end