Skip to content
代码片段 群组 项目
提交 2f60b1ce 编辑于 作者: bmarjanovic's avatar bmarjanovic
浏览文件

Convert Pumble integration to use DSL

上级 d26f38f5
No related branches found
No related tags found
无相关合并请求
......@@ -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
......
......@@ -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
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册