diff --git a/app/models/integrations/pumble.rb b/app/models/integrations/pumble.rb index e08dc6d0f513bb5e0141243a1de395ee5cb0d7c8..85fb3b9c3e638d81c5b002c2459bb0551ba6500f 100644 --- a/app/models/integrations/pumble.rb +++ b/app/models/integrations/pumble.rb @@ -2,6 +2,24 @@ module Integrations class Pumble < BaseChatNotification + undef :notify_only_broken_pipelines + + field :webhook, + section: SECTION_TYPE_CONNECTION, + help: 'https://api.pumble.com/workspaces/x/...', + required: true + + field :notify_only_broken_pipelines, + type: 'checkbox', + section: SECTION_TYPE_CONFIGURATION, + help: 'If selected, successful pipelines do not trigger a notification event.' + + field :branches_to_be_notified, + type: 'select', + section: SECTION_TYPE_CONFIGURATION, + title: -> { s_('Integrations|Branches for which notifications are to be sent') }, + choices: -> { branch_choices } + def title 'Pumble' end @@ -34,17 +52,8 @@ def self.supported_events pipeline wiki_page] end - def default_fields - [ - { type: 'text', name: 'webhook', help: 'https://api.pumble.com/workspaces/x/...', required: true }, - { type: 'checkbox', name: 'notify_only_broken_pipelines' }, - { - type: 'select', - name: 'branches_to_be_notified', - title: s_('Integrations|Branches for which notifications are to be sent'), - choices: self.class.branch_choices - } - ] + def fields + self.class.fields + build_event_channels end private diff --git a/spec/models/integrations/pumble_spec.rb b/spec/models/integrations/pumble_spec.rb index 8b9b5d214c6deb35525107bae6ac7e5ad2b593ab..8d966ff5da550b76291bd7cf32b8f0a9745233f0 100644 --- a/spec/models/integrations/pumble_spec.rb +++ b/spec/models/integrations/pumble_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe Integrations::Pumble do +RSpec.describe Integrations::Pumble, feature_category: :integrations do it_behaves_like "chat integration", "Pumble" do let(:client_arguments) { webhook_url } let(:payload) do