Commit 6dcbd646 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

disable mailer for Spinach

parent b8ba0b75
...@@ -35,7 +35,7 @@ Capybara.ignore_hidden_elements = false ...@@ -35,7 +35,7 @@ Capybara.ignore_hidden_elements = false
DatabaseCleaner.strategy = :truncation DatabaseCleaner.strategy = :truncation
Spinach.hooks.before_scenario do Spinach.hooks.before_scenario do
TestEnv.init TestEnv.init(mailer: false)
DatabaseCleaner.start DatabaseCleaner.start
end end
......
...@@ -21,6 +21,10 @@ module TestEnv ...@@ -21,6 +21,10 @@ module TestEnv
# #
disable_observers if opts[:observers] == false disable_observers if opts[:observers] == false
# Disable mailer for spinach tests
disable_mailer if opts[:mailer] == false
# Use tmp dir for FS manipulations # Use tmp dir for FS manipulations
repos_path = Rails.root.join('tmp', 'test-git-base-path') repos_path = Rails.root.join('tmp', 'test-git-base-path')
Gitlab.config.gitlab_shell.stub(repos_path: repos_path) Gitlab.config.gitlab_shell.stub(repos_path: repos_path)
...@@ -76,4 +80,8 @@ module TestEnv ...@@ -76,4 +80,8 @@ module TestEnv
def disable_observers def disable_observers
ActiveRecord::Base.observers.disable(:all) ActiveRecord::Base.observers.disable(:all)
end end
def disable_mailer
ActionMailer::Base.perform_deliveries = false
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment