diff options
author | Alexandru Croitor <acroitor@gitlab.com> | 2019-02-20 17:18:15 +0200 |
---|---|---|
committer | Alexandru Croitor <acroitor@gitlab.com> | 2019-02-27 22:07:50 +0200 |
commit | 77985826d94454514c40b8da926e13b3b3791841 (patch) | |
tree | 00da4c2f5b72001e38b56e9d994cabc278ec0d7c /spec/mailers/abuse_report_mailer_spec.rb | |
parent | 177f9ca88b4d080e91b6c4ce2bba04d2fba95c07 (diff) | |
download | gitlab-ce-77985826d94454514c40b8da926e13b3b3791841.tar.gz |
Show header and footer system messages in email
* Add email_header_and_footer_enabled flag to appearances table
* Set email_header_and_footer_enabled default value to false
* Add checkbox to appearance to toggle show header and footer in emails
* Add email_header_and_footer_enabled to allowed params in controller
* Add header and footer messages to the html and text email layouts
* Remove the color styling for emails header and footer
* Add empty_mailer layout for emails without layout,
to have the header and footer applied
Diffstat (limited to 'spec/mailers/abuse_report_mailer_spec.rb')
-rw-r--r-- | spec/mailers/abuse_report_mailer_spec.rb | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/spec/mailers/abuse_report_mailer_spec.rb b/spec/mailers/abuse_report_mailer_spec.rb index bda892083b3..f96870cc112 100644 --- a/spec/mailers/abuse_report_mailer_spec.rb +++ b/spec/mailers/abuse_report_mailer_spec.rb @@ -4,25 +4,24 @@ describe AbuseReportMailer do include EmailSpec::Matchers describe '.notify' do - context 'with admin_notification_email set' do - before do - stub_application_setting(admin_notification_email: 'admin@example.com') - end + before do + stub_application_setting(admin_notification_email: 'admin@example.com') + end - it 'sends to the admin_notification_email' do - report = create(:abuse_report) + let(:report) { create(:abuse_report) } + + subject { described_class.notify(report.id) } - mail = described_class.notify(report.id) + it_behaves_like 'appearance header and footer enabled' + it_behaves_like 'appearance header and footer not enabled' - expect(mail).to deliver_to 'admin@example.com' + context 'with admin_notification_email set' do + it 'sends to the admin_notification_email' do + is_expected.to deliver_to 'admin@example.com' end it 'includes the user in the subject' do - report = create(:abuse_report) - - mail = described_class.notify(report.id) - - expect(mail).to have_subject "#{report.user.name} (#{report.user.username}) was reported for abuse" + is_expected.to have_subject "#{report.user.name} (#{report.user.username}) was reported for abuse" end end |