From 54a3d82eab5ccf82549175960e87bbd37ed20852 Mon Sep 17 00:00:00 2001 From: Markus Kahl Date: Wed, 11 Nov 2015 13:14:20 +0000 Subject: [PATCH] updated spec; we now create 15 work packages --- spec/seeders/demo_data_seeder_spec.rb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/spec/seeders/demo_data_seeder_spec.rb b/spec/seeders/demo_data_seeder_spec.rb index 0e83bbc4ed..034067e9a5 100644 --- a/spec/seeders/demo_data_seeder_spec.rb +++ b/spec/seeders/demo_data_seeder_spec.rb @@ -31,19 +31,23 @@ require 'spec_helper' describe 'seeds' do it 'create the demo data' do - # Disable mail delivery for the duration of this task + perform_deliveries = ActionMailer::Base.perform_deliveries ActionMailer::Base.perform_deliveries = false - # Avoid asynchronous DeliverWorkPackageCreatedJob - Delayed::Worker.delay_jobs = false + begin + # Avoid asynchronous DeliverWorkPackageCreatedJob + Delayed::Worker.delay_jobs = false - expect{ BasicDataSeeder.seed! }.not_to raise_error - expect{ AdminUserSeeder.new.seed! }.not_to raise_error - expect{ DemoDataSeeder.seed! }.not_to raise_error + expect{ BasicDataSeeder.seed! }.not_to raise_error + expect{ AdminUserSeeder.new.seed! }.not_to raise_error + expect{ DemoDataSeeder.seed! }.not_to raise_error - expect(Project.count).to eq 1 - expect(WorkPackage.count).to eq 13 - expect(Wiki.count).to eq 1 - expect(Query.count).to eq 6 + expect(Project.count).to eq 1 + expect(WorkPackage.count).to eq 15 + expect(Wiki.count).to eq 1 + expect(Query.count).to eq 6 + ensure + ActionMailer::Base.perform_deliveries = perform_deliveries + end end end