diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 507ede5db2b8a10997b92ee4fb05d5ba14251b6a..1fc4f232c31b8920c434d41a2aaa9eb7110497cd 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -48,8 +48,8 @@ class Notifier < ActionMailer::Base I18n.with_locale(locale) do mail(mail_opts) do |format| - format.text - format.html + format.text { render :layout => nil } + format.html { render :layout => nil } end end end diff --git a/features/accepts_invitation.feature b/features/accepts_invitation.feature index 720541909fce6e321ec6229a2de7ddc3ec59558e..5ee4119b6eab636399ad79dc97e162e62cb113c4 100644 --- a/features/accepts_invitation.feature +++ b/features/accepts_invitation.feature @@ -45,3 +45,4 @@ Feature: invitation acceptance And I fill in "email_inviter_emails" with "alex@example.com" And I press "Send an invitation" Then I should have 1 Devise email delivery + And I should not see "change your notification settings" in the last sent email diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index c2a7897a0d67aa9318bc4a4924928b43683e8cef..e124ce29b431faf4e2a4300aa9c775b239b43056 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -129,6 +129,11 @@ Then /^I should have (\d+) email delivery$/ do |n| ActionMailer::Base.deliveries.length.should == n.to_i end +Then /^I should not see "([^\"]*)" in the last sent email$/ do |text| + email_text = Devise.mailer.deliveries.first.body.to_s + email_text = Devise.mailer.deliveries.first.html_part.body.raw_source if email_text.blank? + email_text.should_not match(text) +end When /^"([^\"]+)" has posted a status message with a photo$/ do |email| user = User.find_for_database_authentication(:username => email)