diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-13 16:26:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-13 16:26:31 +0300 |
commit | b7dfe2ae4054aa40e15182fd3c6cb7dd39f131db (patch) | |
tree | 5ab080ca9cadeb6cd9578bf301e4e9e8810bed9e /spec/lib/gitlab/email | |
parent | 25cb337cf12438169f1b14bc5dace8a06a7356e3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/email')
-rw-r--r-- | spec/lib/gitlab/email/receiver_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb index c9fde06cbae..6b5a355e598 100644 --- a/spec/lib/gitlab/email/receiver_spec.rb +++ b/spec/lib/gitlab/email/receiver_spec.rb @@ -14,6 +14,7 @@ describe Gitlab::Email::Receiver do allow(handler).to receive(:execute) allow(handler).to receive(:metrics_params) + allow(handler).to receive(:metrics_event) end it "finds the mail key" do @@ -46,4 +47,12 @@ describe Gitlab::Email::Receiver do expect { receiver.execute }.to raise_error(Gitlab::Email::AutoGeneratedEmailError) end end + + it "requires all handlers to have a unique metric_event" do + events = Gitlab::Email::Handler.handlers.map do |handler| + handler.new(Mail::Message.new, 'gitlabhq/gitlabhq+auth_token').metrics_event + end + + expect(events.uniq.count).to eq events.count + end end |