From ef2c8593b9f80951e97fadb5a3c9c5cdf0f1b1c9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 11 Apr 2013 23:54:20 +0300 Subject: Disable mailer for spinach --- spec/support/test_env.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'spec/support') diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb index 175698ac9c9..8a2e004f824 100644 --- a/spec/support/test_env.rb +++ b/spec/support/test_env.rb @@ -1,3 +1,5 @@ +require 'rspec/mocks' + module TestEnv extend self @@ -13,6 +15,8 @@ module TestEnv # - remove_key # def init(opts = {}) + RSpec::Mocks::setup(self) + # Disable observers to improve test speed # # You can enable it in whole test case where needed by next string: @@ -82,6 +86,6 @@ module TestEnv end def disable_mailer - ActionMailer::Base.perform_deliveries = false + NotificationService.any_instance.stub(mailer: double.as_null_object) end end -- cgit v1.2.1