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