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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:40:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:40:28 +0300
commitb595cb0c1dec83de5bdee18284abe86614bed33b (patch)
tree8c3d4540f193c5ff98019352f554e921b3a41a72 /spec/models/integrations/base_chat_notification_spec.rb
parent2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff)
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'spec/models/integrations/base_chat_notification_spec.rb')
-rw-r--r--spec/models/integrations/base_chat_notification_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/integrations/base_chat_notification_spec.rb b/spec/models/integrations/base_chat_notification_spec.rb
index 672d8de1e14..eb503e501d6 100644
--- a/spec/models/integrations/base_chat_notification_spec.rb
+++ b/spec/models/integrations/base_chat_notification_spec.rb
@@ -285,4 +285,22 @@ RSpec.describe Integrations::BaseChatNotification do
expect { subject.webhook_placeholder }.to raise_error(NotImplementedError)
end
end
+
+ describe '#event_channel_name' do
+ it 'returns the channel field name for the given event' do
+ expect(subject.event_channel_name(:event)).to eq('event_channel')
+ end
+ end
+
+ describe '#event_channel_value' do
+ it 'returns the channel field value for the given event' do
+ subject.push_channel = '#pushes'
+
+ expect(subject.event_channel_value(:push)).to eq('#pushes')
+ end
+
+ it 'raises an error for unsupported events' do
+ expect { subject.event_channel_value(:foo) }.to raise_error(NoMethodError)
+ end
+ end
end