added mailer
This commit is contained in:
@@ -20,7 +20,10 @@ feature 'Support announcement' do
|
||||
|
||||
sleep 5 # Do a real sleep to have a real integration test
|
||||
|
||||
expect(ActionMailer::Base.deliveries.count).to eq 0
|
||||
expect { click_button 'Unterstützung zusichern' }.to change { Supporter.count }.by(1)
|
||||
expect(ActionMailer::Base.deliveries.count).to eq 1
|
||||
|
||||
supporter = Supporter.find_by(email: 'blocher@blocher.ch')
|
||||
expect(supporter.coordinates).to eq [8.618589100000001, 47.2926304]
|
||||
expect(supporter.comments).to eq 'Test text'
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Preview all emails at http://localhost:3000/rails/mailers/supporter_mailer
|
||||
class SupporterMailerPreview < ActionMailer::Preview
|
||||
def welcome
|
||||
SupporterMailer.welcome_email(Supporter.first)
|
||||
end
|
||||
end
|
||||
@@ -44,4 +44,8 @@ RSpec.configure do |config|
|
||||
config.after(:each) do
|
||||
Mongoid.purge!
|
||||
end
|
||||
|
||||
config.before(:each) do
|
||||
ActionMailer::Base.deliveries.clear
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user