diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-11 11:50:58 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-11 11:50:58 +0300 |
commit | 6dcbd646ddc629258b017b2d08f2b98c076eb1c3 (patch) | |
tree | 7b0e1603dc8f065a064dd360b3a3ebc810d75cdb | |
parent | b8ba0b759cd474c7097078057cad40fb8922f4e0 (diff) | |
download | gitlab-ce-6dcbd646ddc629258b017b2d08f2b98c076eb1c3.tar.gz |
disable mailer for Spinach
-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 |