diff options
-rw-r--r-- | features/support/env.rb | 2 | ||||
-rw-r--r-- | spec/support/test_env.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/features/support/env.rb b/features/support/env.rb index 7c8a4aa9373..1693a588993 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -35,7 +35,7 @@ Capybara.ignore_hidden_elements = false DatabaseCleaner.strategy = :truncation Spinach.hooks.before_scenario do - TestEnv.init + TestEnv.init(mailer: false) DatabaseCleaner.start end diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb index 5358143c62b..175698ac9c9 100644 --- a/spec/support/test_env.rb +++ b/spec/support/test_env.rb @@ -21,6 +21,10 @@ module TestEnv # disable_observers if opts[:observers] == false + # Disable mailer for spinach tests + disable_mailer if opts[:mailer] == false + + # Use tmp dir for FS manipulations repos_path = Rails.root.join('tmp', 'test-git-base-path') Gitlab.config.gitlab_shell.stub(repos_path: repos_path) @@ -76,4 +80,8 @@ module TestEnv def disable_observers ActiveRecord::Base.observers.disable(:all) end + + def disable_mailer + ActionMailer::Base.perform_deliveries = false + end end |