Skip to content
Extraits de code Groupes Projets
Valider 2ae366ad rédigé par Steven Hancock's avatar Steven Hancock
Parcourir les fichiers

Render invitation email without a layout

Ideally, we'll probably want to add a layout for this email at some point,
but this simplifies it to the bare minimum and gets rid of the "click here
to change your notification settings" link.

fixes #3270
parent 27aff7fb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -48,8 +48,8 @@ class Notifier < ActionMailer::Base ...@@ -48,8 +48,8 @@ class Notifier < ActionMailer::Base
I18n.with_locale(locale) do I18n.with_locale(locale) do
mail(mail_opts) do |format| mail(mail_opts) do |format|
format.text format.text { render :layout => nil }
format.html format.html { render :layout => nil }
end end
end end
end end
......
...@@ -45,3 +45,4 @@ Feature: invitation acceptance ...@@ -45,3 +45,4 @@ Feature: invitation acceptance
And I fill in "email_inviter_emails" with "alex@example.com" And I fill in "email_inviter_emails" with "alex@example.com"
And I press "Send an invitation" And I press "Send an invitation"
Then I should have 1 Devise email delivery Then I should have 1 Devise email delivery
And I should not see "change your notification settings" in the last sent email
...@@ -129,6 +129,11 @@ Then /^I should have (\d+) email delivery$/ do |n| ...@@ -129,6 +129,11 @@ Then /^I should have (\d+) email delivery$/ do |n|
ActionMailer::Base.deliveries.length.should == n.to_i ActionMailer::Base.deliveries.length.should == n.to_i
end 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| When /^"([^\"]+)" has posted a status message with a photo$/ do |email|
user = User.find_for_database_authentication(:username => email) user = User.find_for_database_authentication(:username => email)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter