Remove puts from specs, fix failing controller spec

This commit is contained in:
Rohan Mitchell
2015-04-29 14:46:20 +10:00
parent 6b1c125b03
commit 36584f0177
2 changed files with 4 additions and 3 deletions

View File

@@ -108,14 +108,16 @@ module Admin
before do
controller.stub spree_current_user: admin_user
spree_post :notify_producers, {id: order_cycle.id}
end
it "enqueues a job" do
expect(Delayed::Job).to receive(:enqueue).once
expect do
spree_post :notify_producers, {id: order_cycle.id}
end.to enqueue_job OrderCycleNotificationJob
end
it "redirects back to the order cycles path with a success message" do
spree_post :notify_producers, {id: order_cycle.id}
expect(response).to redirect_to admin_order_cycles_path
flash[:notice].should == 'Emails to be sent to producers have been queued for sending.'
end

View File

@@ -28,7 +28,6 @@ describe ProducerMailer do
it "should send an email when an order cycle is closed" do
ProducerMailer.order_cycle_report(s1, order_cycle).deliver
puts ActionMailer::Base.deliveries
ActionMailer::Base.deliveries.count.should == 1
end