debian-mirror-gitlab/spec/factories/labels.rb

24 lines
488 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
FactoryGirl.define do
2016-11-03 12:29:30 +05:30
factory :label, class: ProjectLabel do
2016-06-02 11:05:42 +05:30
sequence(:title) { |n| "label#{n}" }
2014-09-02 18:07:02 +05:30
color "#990000"
project
2016-11-03 12:29:30 +05:30
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
2014-09-02 18:07:02 +05:30
end
end