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
DatabaseCleaner.strategy = :truncation
Spinach.hooks.before_scenario do
TestEnv.init
TestEnv.init(mailer: false)
DatabaseCleaner.start
end
......
......@@ -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
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