Commit ff99ac2c authored by Douwe Maan's avatar Douwe Maan

Use POST method for group webhook test action

parent 2a89ae02
......@@ -83,7 +83,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
member do
get :test
post :test
end
end
......
......@@ -9,7 +9,7 @@
.col-md-4.col-lg-5.text-right-lg.prepend-top-5
%span.append-right-10.inline
SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"}
= link_to "Test", test_group_hook_path(@group, hook), class: "btn btn-sm"
= link_to "Test", test_group_hook_path(@group, hook), class: "btn btn-sm", method: :post
= link_to group_hook_path(@group, hook), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-transparent" do
%span.sr-only Remove
= icon('trash')
require "spec_helper"
require "rails_helper"
describe "User tests hooks" do
set(:group) { create(:group) }
set(:hook) { create(:group_hook, group: group) }
set(:user) { create(:user) }
describe "User tests hooks", :js do
let!(:group) { create(:group) }
let!(:hook) { create(:group_hook, group: group) }
let!(:user) { create(:user) }
before do
group.add_owner(user)
......
......@@ -7,7 +7,7 @@ describe "routes to the proper webhooks controller", type: :routing do
it "routes the test action" do
expect(
get: polymorphic_path([project.namespace.becomes(Namespace), project, project_hook], action: :test)
post: polymorphic_path([project.namespace.becomes(Namespace), project, project_hook], action: :test)
).to route_to(controller: 'projects/hooks',
action: 'test',
namespace_id: project.namespace.name,
......@@ -32,7 +32,7 @@ describe "routes to the proper webhooks controller", type: :routing do
it "routes the test action" do
expect(
get: polymorphic_path([group, group_hook], action: :test)
post: polymorphic_path([group, group_hook], action: :test)
).to route_to(controller: 'groups/hooks',
action: 'test',
group_id: group.name,
......
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