diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-10-31 10:24:29 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-10-31 10:24:29 +0000 |
commit | 7e78db6e04c3760c90d676e9a797b1b16b1dff7b (patch) | |
tree | 7bbe33a6808b75eecf1f5afe37495fe4f6f4be1c /spec | |
parent | e25acf24baf365f66c65a9dc3fdc8bc49b9546de (diff) | |
parent | eddc9e41a6df94e55f9df91241a83e2ae3439c49 (diff) | |
download | gitlab-ce-7e78db6e04c3760c90d676e9a797b1b16b1dff7b.tar.gz |
Merge branch '39593-emails-on-push-are-sent-to-only-the-first-recipient-when-using-aws-ses' into 'master'
Resolve "Emails on Push are sent to only the first recipient when using AWS SES"
Closes #39593
See merge request gitlab-org/gitlab-ce!15083
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/additional_email_headers_interceptor_spec.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/lib/additional_email_headers_interceptor_spec.rb b/spec/lib/additional_email_headers_interceptor_spec.rb index 580450eef1e..b5c1a360ba9 100644 --- a/spec/lib/additional_email_headers_interceptor_spec.rb +++ b/spec/lib/additional_email_headers_interceptor_spec.rb @@ -1,12 +1,29 @@ require 'spec_helper' describe AdditionalEmailHeadersInterceptor do - it 'adds Auto-Submitted header' do - mail = ActionMailer::Base.mail(to: 'test@mail.com', from: 'info@mail.com', body: 'hello').deliver + let(:mail) do + ActionMailer::Base.mail(to: 'test@mail.com', from: 'info@mail.com', body: 'hello') + end + + before do + mail.deliver_now + end + it 'adds Auto-Submitted header' do expect(mail.header['To'].value).to eq('test@mail.com') expect(mail.header['From'].value).to eq('info@mail.com') expect(mail.header['Auto-Submitted'].value).to eq('auto-generated') expect(mail.header['X-Auto-Response-Suppress'].value).to eq('All') end + + context 'when the same mail object is sent twice' do + before do + mail.deliver_now + end + + it 'does not add the Auto-Submitted header twice' do + expect(mail.header['Auto-Submitted'].value).to eq('auto-generated') + expect(mail.header['X-Auto-Response-Suppress'].value).to eq('All') + end + end end |