2022-09-22 18:16:19 +02:00
|
|
|
describe '20220922151100_populate_zones' do
|
|
|
|
let(:rake_task) { Rake::Task['after_party:populate_zones'] }
|
2021-12-14 14:33:19 +01:00
|
|
|
subject(:run_task) do
|
2022-09-22 18:16:19 +02:00
|
|
|
Flipper.enable :zonage
|
2021-12-14 14:33:19 +01:00
|
|
|
rake_task.invoke
|
|
|
|
end
|
2021-12-21 10:49:36 +01:00
|
|
|
after(:each) do
|
|
|
|
rake_task.reenable
|
|
|
|
end
|
2021-12-14 14:33:19 +01:00
|
|
|
|
|
|
|
it 'populates zones' do
|
|
|
|
run_task
|
|
|
|
expect(Zone.find_by(acronym: 'PM').label).to eq "Premier ministre"
|
2022-08-12 17:19:42 +02:00
|
|
|
expect(Zone.find_by(acronym: 'MTEI').labels.first.designated_on).to eq Date.parse('2022-05-20')
|
|
|
|
expect(Zone.find_by(acronym: 'MTEI').labels.first.name).to eq "Ministère du Travail, du Plein emploi et de l'Insertion"
|
|
|
|
expect(Zone.find_by(acronym: 'MTEI').labels.last.designated_on).to eq Date.parse('2020-07-06')
|
|
|
|
expect(Zone.find_by(acronym: 'MTEI').labels.last.name).to eq "Ministère du Travail"
|
2021-12-14 14:33:19 +01:00
|
|
|
end
|
|
|
|
end
|