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/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/service_spec.rb')
-rw-r--r-- | spec/models/service_spec.rb | 16 |
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) } |