diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
commit | db384e6b19af03b4c3c82a5760d83a3fd79f7982 (patch) | |
tree | 34beaef37df5f47ccbcf5729d7583aae093cffa0 /spec/serializers/integrations/event_entity_spec.rb | |
parent | 54fd7b1bad233e3944434da91d257fa7f63c3996 (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-eev16.3.0-rc42
Diffstat (limited to 'spec/serializers/integrations/event_entity_spec.rb')
-rw-r--r-- | spec/serializers/integrations/event_entity_spec.rb | 21 |
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 |