demarches-normaliennes/spec/lib/tasks/deployment/20220922151100_populate_zones_spec.rake

20 lines
766 B
Ruby
Raw Normal View History

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
Flipper.enable :zonage
2021-12-14 14:33:19 +01:00
rake_task.invoke
end
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