Commit 89463fc7 authored by Robert Speicher's avatar Robert Speicher

Merge branch '1853-fix-group-webhook-token' into 'master'

Allow all parameters of group webhooks to be set through the UI

Closes #1853

See merge request !1376
parents 95545627 77abe255
......@@ -53,8 +53,19 @@ class Groups::HooksController < Groups::ApplicationController
end
def hook_params
params.require(:hook).permit(:url, :push_events, :issues_events,
:merge_requests_events, :tag_push_events, :note_events,
:build_events, :enable_ssl_verification)
params.require(:hook).permit(
:build_events,
:confidential_issues_events,
:enable_ssl_verification,
:issues_events,
:merge_requests_events,
:note_events,
:pipeline_events,
:push_events,
:tag_push_events,
:token,
:url,
:wiki_page_events
)
end
end
---
title: Allow all parameters of group webhooks to be set through the UI
merge_request: 1376
author:
require 'spec_helper'
describe Groups::HooksController do
let(:user) { create(:user) }
let(:group) { create(:group) }
before do
group.add_owner(user)
sign_in(user)
end
describe 'POST #create' do
it 'sets all parameters' do
hook_params = {
build_events: true,
confidential_issues_events: true,
enable_ssl_verification: true,
issues_events: true,
merge_requests_events: true,
note_events: true,
pipeline_events: true,
push_events: true,
tag_push_events: true,
token: "TEST TOKEN",
url: "http://example.com",
wiki_page_events: true,
}
post :create, group_id: group.to_param, hook: hook_params
expect(response).to have_http_status(302)
expect(group.hooks.size).to eq(1)
expect(group.hooks.first).to have_attributes(hook_params)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment