diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-04-03 11:00:33 +0000 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-04-05 08:41:56 +0200 |
commit | 52967b107b7b2f1472b4c005f70f21346079cd95 (patch) | |
tree | 12e99d4fe27f69af53920bd4db3a81e473def642 /spec/models/project_services/hipchat_service_spec.rb | |
parent | 98106ec54e439455f545f3df15332a28b9b0c969 (diff) | |
download | gitlab-ce-52967b107b7b2f1472b4c005f70f21346079cd95.tar.gz |
Merge branch 'jej/mattermost-notification-confidentiality-10-6' into 'security-10-6'
[10.6] Prevent notes on confidential issues from being sent to chat
See merge request gitlab/gitlabhq!2366
# Conflicts:
# app/helpers/services_helper.rb
Diffstat (limited to 'spec/models/project_services/hipchat_service_spec.rb')
-rw-r--r-- | spec/models/project_services/hipchat_service_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/project_services/hipchat_service_spec.rb b/spec/models/project_services/hipchat_service_spec.rb index 3e2a166cdd6..0cd712e2f40 100644 --- a/spec/models/project_services/hipchat_service_spec.rb +++ b/spec/models/project_services/hipchat_service_spec.rb @@ -253,6 +253,21 @@ describe HipchatService do "<b>#{title}</b>" \ "<pre>issue <strong>note</strong></pre>") end + + context 'with confidential issue' do + before do + issue.update!(confidential: true) + end + + it 'calls Hipchat API with issue comment' do + data = Gitlab::DataBuilder::Note.build(issue_note, user) + hipchat.execute(data) + + message = hipchat.send(:create_message, data) + + expect(message).to include("<pre>issue <strong>note</strong></pre>") + end + end end context 'when snippet comment event triggered' do |