2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-12-01 21:38:41 +01:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :zone do
|
|
|
|
sequence(:acronym) { |n| "MA#{n}" }
|
2023-03-27 15:38:25 +02:00
|
|
|
tchap_hs { ['agent.educpop.tchap.gouv.fr'] }
|
2022-08-11 19:05:12 +02:00
|
|
|
transient do
|
|
|
|
labels { [{ designated_on: '1981-05-08', name: "Ministère de l'Education Populaire" }] }
|
|
|
|
end
|
|
|
|
|
2022-11-24 13:16:37 +01:00
|
|
|
after(:build) do |zone, evaluator|
|
2022-08-11 19:05:12 +02:00
|
|
|
evaluator.labels.each do |label|
|
2022-11-24 13:16:37 +01:00
|
|
|
zone.labels.build(designated_on: label[:designated_on], name: label[:name])
|
2022-08-11 19:05:12 +02:00
|
|
|
end
|
|
|
|
end
|
2021-12-01 21:38:41 +01:00
|
|
|
end
|
|
|
|
end
|