Commit 84dc6834 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'sk/333828-fix-update-policy' into 'master'

Add constraint to id param for NetworkPoliciesController

See merge request gitlab-org/gitlab!65346
parents a15a85d2 217408c3
......@@ -53,7 +53,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources :audit_events, only: [:index]
namespace :security do
resources :network_policies, only: [:index, :create, :update, :destroy] do
resources :network_policies, only: [:index, :create, :update, :destroy], constraints: { id: %r{[^/]+} } do
get :summary, on: :collection
end
......
......@@ -82,4 +82,16 @@ RSpec.describe 'EE-specific project routing' do
end
end
end
describe Projects::Security::NetworkPoliciesController, 'routing' do
where(:id) do
%w[test.1.2 test-policy test:policy]
end
with_them do
it "to #update" do
expect(put("/gitlab/gitlabhq/-/security/network_policies/#{id}")).to route_to('projects/security/network_policies#update', namespace_id: 'gitlab', project_id: 'gitlabhq', id: id)
end
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