diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-01-29 17:53:45 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-01-29 17:53:45 +1100 |
commit | 0925f8b6ddd30f6edc19741e1ebee348d08f4a61 (patch) | |
tree | 6c09426d4484b8d20f28b8eeeb7a6e99aaacbf7e /spec/spec_helper.rb | |
parent | 2170a716b02baf65c1470ffc7d85056767a86364 (diff) |
Clear out ActionMailer::Base.deliveries before each test. Rspec should be doing this but isn't for controller tests
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 09a808061..e79b8d777 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -52,6 +52,13 @@ RSpec.configure do |config| # the seed, which is printed after each run. # --seed 1234 #config.order = "random" + + # This is a workaround for a strange thing where ActionMailer::Base.deliveries isn't being + # cleared out correctly in controller specs. So, do it here for everything. + config.before(:each) do + ActionMailer::Base.deliveries = [] + end + end # XXX No idea what namespace/class/module to put this in |