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:
Diffstat (limited to 'spec/serializers/integrations/event_entity_spec.rb')
-rw-r--r--spec/serializers/integrations/event_entity_spec.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/serializers/integrations/event_entity_spec.rb b/spec/serializers/integrations/event_entity_spec.rb
index 1b72b5d290c..a15c1bea61a 100644
--- a/spec/serializers/integrations/event_entity_spec.rb
+++ b/spec/serializers/integrations/event_entity_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Integrations::EventEntity do
+RSpec.describe Integrations::EventEntity, feature_category: :integrations do
let(:request) { EntityRequest.new(integration: integration) }
subject { described_class.new(event, request: request, integration: integration).as_json }
@@ -38,5 +38,24 @@ RSpec.describe Integrations::EventEntity do
expect(subject[:field][:placeholder]).to eq('#general, #development')
end
end
+
+ context 'with integration with fields when channels are masked' do
+ let(:integration) { create(:integrations_slack, note_events: false, note_channel: 'note-channel') }
+ let(:event) { 'note' }
+
+ before do
+ allow(integration).to receive(:mask_configurable_channels?).and_return(true)
+ end
+
+ it 'exposes correct attributes' do
+ expect(subject[:description]).to eq('Trigger event for new comments.')
+ expect(subject[:name]).to eq('note_events')
+ expect(subject[:title]).to eq('Note')
+ expect(subject[:value]).to eq(false)
+ expect(subject[:field][:name]).to eq('note_channel')
+ expect(subject[:field][:value]).to eq(Integrations::BaseChatNotification::SECRET_MASK)
+ expect(subject[:field][:placeholder]).to eq('#general, #development')
+ end
+ end
end
end