demarches-normaliennes/spec/factories/zone.rb
Christophe Robillard a504e82021 add zone label
2022-09-26 16:58:53 +02:00

14 lines
394 B
Ruby

FactoryBot.define do
factory :zone do
sequence(:acronym) { |n| "MA#{n}" }
transient do
labels { [{ designated_on: '1981-05-08', name: "Ministère de l'Education Populaire" }] }
end
after(:create) do |zone, evaluator|
evaluator.labels.each do |label|
zone.labels.create(designated_on: label[:designated_on], name: label[:name])
end
end
end
end