summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-01-23 20:39:16 +0000
committerDouwe Maan <douwe@gitlab.com>2017-01-23 20:39:16 +0000
commitc24a2d3298318313d466e209413bb82b3f365306 (patch)
tree25d9faf7786c07d4db08f44427463e3cf93d648c /spec/support
parent0d77b99cddbf891c872c4a2b788fa2eebb3d49e5 (diff)
parentc3a940000ea20d6682313640e1a0fda9ff68dbdf (diff)
downloadgitlab-ce-c24a2d3298318313d466e209413bb82b3f365306.tar.gz
Merge branch '22619-add-an-email-address-to-unsubscribe-list-header-in-email' into 'master'
Handle unsubscribe notification via email Closes #22619 See merge request !6597
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/notify_shared_examples.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/support/notify_shared_examples.rb b/spec/support/notify_shared_examples.rb
index 49867aa5cc4..a3724b801b3 100644
--- a/spec/support/notify_shared_examples.rb
+++ b/spec/support/notify_shared_examples.rb
@@ -179,9 +179,24 @@ shared_examples 'it should show Gmail Actions View Commit link' do
end
shared_examples 'an unsubscribeable thread' do
+ it_behaves_like 'an unsubscribeable thread with incoming address without %{key}'
+
+ it 'has a List-Unsubscribe header in the correct format' do
+ is_expected.to have_header 'List-Unsubscribe', /unsubscribe/
+ is_expected.to have_header 'List-Unsubscribe', /mailto/
+ is_expected.to have_header 'List-Unsubscribe', /^<.+,.+>$/
+ end
+
+ it { is_expected.to have_body_text /unsubscribe/ }
+end
+
+shared_examples 'an unsubscribeable thread with incoming address without %{key}' do
+ include_context 'reply-by-email is enabled with incoming address without %{key}'
+
it 'has a List-Unsubscribe header in the correct format' do
is_expected.to have_header 'List-Unsubscribe', /unsubscribe/
- is_expected.to have_header 'List-Unsubscribe', /^<.+>$/
+ is_expected.not_to have_header 'List-Unsubscribe', /mailto/
+ is_expected.to have_header 'List-Unsubscribe', /^<[^,]+>$/
end
it { is_expected.to have_body_text /unsubscribe/ }