Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-04-03 14:00:33 +0300
committerJames Lopez <james@jameslopez.es>2018-04-05 09:41:56 +0300
commit52967b107b7b2f1472b4c005f70f21346079cd95 (patch)
tree12e99d4fe27f69af53920bd4db3a81e473def642 /spec/models/service_spec.rb
parent98106ec54e439455f545f3df15332a28b9b0c969 (diff)
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/service_spec.rb')
-rw-r--r--spec/models/service_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index 83ed3b203e6..28c908ea425 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -10,6 +10,22 @@ describe Service do
it { is_expected.to validate_presence_of(:type) }
end
+ describe 'Scopes' do
+ describe '.confidential_note_hooks' do
+ it 'includes services where confidential_note_events is true' do
+ create(:service, active: true, confidential_note_events: true)
+
+ expect(described_class.confidential_note_hooks.count).to eq 1
+ end
+
+ it 'excludes services where confidential_note_events is false' do
+ create(:service, active: true, confidential_note_events: false)
+
+ expect(described_class.confidential_note_hooks.count).to eq 0
+ end
+ end
+ end
+
describe "Test Button" do
describe '#can_test?' do
let(:service) { create(:service, project: project) }