added mailer

This commit is contained in:
2016-04-08 15:22:31 +02:00
parent 7aacbe8d56
commit 8103f7b439
11 changed files with 71 additions and 0 deletions
+3
View File
@@ -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
+4
View File
@@ -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