aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-29 17:53:45 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-29 17:53:45 +1100
commit0925f8b6ddd30f6edc19741e1ebee348d08f4a61 (patch)
tree6c09426d4484b8d20f28b8eeeb7a6e99aaacbf7e /spec/spec_helper.rb
parent2170a716b02baf65c1470ffc7d85056767a86364 (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.rb7
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