summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/email/handler_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 14:34:42 +0000
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /spec/lib/gitlab/email/handler_spec.rb
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
downloadgitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/lib/gitlab/email/handler_spec.rb')
-rw-r--r--spec/lib/gitlab/email/handler_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/email/handler_spec.rb b/spec/lib/gitlab/email/handler_spec.rb
index 5014e4c22ce..6dbf069f07c 100644
--- a/spec/lib/gitlab/email/handler_spec.rb
+++ b/spec/lib/gitlab/email/handler_spec.rb
@@ -6,6 +6,18 @@ describe Gitlab::Email::Handler do
let(:email) { Mail.new { body 'email' } }
describe '.for' do
+ context 'key matches the reply_key of a notification' do
+ it 'picks note handler' do
+ expect(described_class.for(email, '1234567890abcdef1234567890abcdef')).to be_an_instance_of(Gitlab::Email::Handler::CreateNoteHandler)
+ end
+ end
+
+ context 'key matches the reply_key of a notification, along with an unsubscribe suffix' do
+ it 'picks unsubscribe handler' do
+ expect(described_class.for(email, '1234567890abcdef1234567890abcdef-unsubscribe')).to be_an_instance_of(Gitlab::Email::Handler::UnsubscribeHandler)
+ end
+ end
+
it 'picks issue handler if there is no merge request prefix' do
expect(described_class.for(email, 'project+key')).to be_an_instance_of(Gitlab::Email::Handler::CreateIssueHandler)
end