Workaround occasional mailer test failure

This commit is contained in:
wvengen 2015-01-14 20:57:43 +01:00
parent 2687da357a
commit dbdc7ae4aa
2 changed files with 3 additions and 1 deletions

View file

@ -12,7 +12,7 @@ describe LoginController, :type => :feature do
it 'sends a reset email' do
post reset_password_path, user: {email: user.email}
email = ActionMailer::Base.deliveries.first
expect((email.to rescue [])).to eq [user.email]
expect(email.to).to eq [user.email]
end
end

View file

@ -32,6 +32,8 @@ RSpec.configure do |config|
DatabaseCleaner.start
# maximise window so that buttons can be found on popups
RSpec.current_example.metadata[:js] and page.driver.browser.manage.window.maximize
# clean slate mail queues, not sure why needed - https://github.com/rspec/rspec-rails/issues/661
ActionMailer::Base.deliveries.clear
end
config.after(:each) do
DatabaseCleaner.clean