Commit 6dcbd646ddc629258b017b2d08f2b98c076eb1c3
1 parent
b8ba0b75
Exists in
master
and in
4 other branches
disable mailer for Spinach
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
features/support/env.rb
spec/support/test_env.rb
| ... | ... | @@ -21,6 +21,10 @@ module TestEnv |
| 21 | 21 | # |
| 22 | 22 | disable_observers if opts[:observers] == false |
| 23 | 23 | |
| 24 | + # Disable mailer for spinach tests | |
| 25 | + disable_mailer if opts[:mailer] == false | |
| 26 | + | |
| 27 | + | |
| 24 | 28 | # Use tmp dir for FS manipulations |
| 25 | 29 | repos_path = Rails.root.join('tmp', 'test-git-base-path') |
| 26 | 30 | Gitlab.config.gitlab_shell.stub(repos_path: repos_path) |
| ... | ... | @@ -76,4 +80,8 @@ module TestEnv |
| 76 | 80 | def disable_observers |
| 77 | 81 | ActiveRecord::Base.observers.disable(:all) |
| 78 | 82 | end |
| 83 | + | |
| 84 | + def disable_mailer | |
| 85 | + ActionMailer::Base.perform_deliveries = false | |
| 86 | + end | |
| 79 | 87 | end | ... | ... |