demarches-normaliennes/spec/lib/tasks/populate_zones_spec.rb

15 lines
305 B
Ruby
Raw Normal View History

2021-12-14 14:33:19 +01:00
describe 'populate_zones' do
2021-12-16 09:49:49 +01:00
let(:rake_task) { Rake::Task['zones:populate_zones'] }
2021-12-14 14:33:19 +01:00
subject(:run_task) do
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"
end
end