labels.rb 492 Bytes
Newer Older
1
FactoryGirl.define do
2
  factory :label, class: ProjectLabel do
3
    title { generate(:label) }
4
    color "#990000"
5
    project factory: :empty_project
6 7 8 9 10 11 12 13 14 15

    transient do
      priority nil
    end

    after(:create) do |label, evaluator|
      if evaluator.priority
        label.priorities.create(project: label.project, priority: evaluator.priority)
      end
    end
16
  end
17 18

  factory :group_label, class: GroupLabel do
19
    title { generate(:label) }
20 21 22
    color "#990000"
    group
  end
23
end