Compare rendered mails with correct site title
This commit is contained in:
parent
15d191f50c
commit
6af838b2ba
|
@ -10,14 +10,15 @@ describe UserMailer do
|
|||
|
||||
it 'renders confirmation instructions' do
|
||||
receiver.update!(locale: nil)
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.confirmation_instructions.title')
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.confirmation_instructions.title', title: Setting.site_title)
|
||||
expect(mail.body.encoded).to include 'spec'
|
||||
expect(mail.body.encoded).to include Rails.configuration.x.local_domain
|
||||
end
|
||||
|
||||
include_examples 'localized subject',
|
||||
'devise.mailer.confirmation_instructions.subject',
|
||||
instance: Rails.configuration.x.local_domain
|
||||
instance: Rails.configuration.x.local_domain,
|
||||
title: Setting.site_title
|
||||
end
|
||||
|
||||
describe 'reconfirmation_instructions' do
|
||||
|
@ -25,12 +26,13 @@ describe UserMailer do
|
|||
|
||||
it 'renders reconfirmation instructions' do
|
||||
receiver.update!(email: 'new-email@example.com', locale: nil)
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.reconfirmation_instructions.title')
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.reconfirmation_instructions.title', title: Setting.site_title)
|
||||
expect(mail.body.encoded).to include 'spec'
|
||||
expect(mail.body.encoded).to include Rails.configuration.x.local_domain
|
||||
expect(mail.subject).to eq I18n.t('devise.mailer.reconfirmation_instructions.subject',
|
||||
instance: Rails.configuration.x.local_domain,
|
||||
locale: I18n.default_locale)
|
||||
locale: I18n.default_locale,
|
||||
title: Setting.site_title)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -39,12 +41,13 @@ describe UserMailer do
|
|||
|
||||
it 'renders reset password instructions' do
|
||||
receiver.update!(locale: nil)
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.reset_password_instructions.title')
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.reset_password_instructions.title', title: Setting.site_title)
|
||||
expect(mail.body.encoded).to include 'spec'
|
||||
end
|
||||
|
||||
include_examples 'localized subject',
|
||||
'devise.mailer.reset_password_instructions.subject'
|
||||
'devise.mailer.reset_password_instructions.subject',
|
||||
title: Setting.site_title
|
||||
end
|
||||
|
||||
describe 'password_change' do
|
||||
|
@ -52,11 +55,12 @@ describe UserMailer do
|
|||
|
||||
it 'renders password change notification' do
|
||||
receiver.update!(locale: nil)
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.password_change.title')
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.password_change.title', title: Setting.site_title)
|
||||
end
|
||||
|
||||
include_examples 'localized subject',
|
||||
'devise.mailer.password_change.subject'
|
||||
'devise.mailer.password_change.subject',
|
||||
title: Setting.site_title
|
||||
end
|
||||
|
||||
describe 'email_changed' do
|
||||
|
@ -64,11 +68,12 @@ describe UserMailer do
|
|||
|
||||
it 'renders email change notification' do
|
||||
receiver.update!(locale: nil)
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.email_changed.title')
|
||||
expect(mail.body.encoded).to include I18n.t('devise.mailer.email_changed.title', title: Setting.site_title)
|
||||
end
|
||||
|
||||
include_examples 'localized subject',
|
||||
'devise.mailer.email_changed.subject'
|
||||
'devise.mailer.email_changed.subject',
|
||||
title: Setting.site_title
|
||||
end
|
||||
|
||||
describe 'warning' do
|
||||
|
|
Loading…
Reference in New Issue