Add LocationNameConverter.to_visible_internal_name to check that a given location is a valid visible location. Add Clover#check_visible_location, which calls to_visible_internal_name and halts route processing if a location is not a valid visible location. Use this in the routes in all cases where @location was being set manually. Change delete specs that use invalid locations to expect 404 instead of 204. 204 is not needed, as the deletion could never have succeeded with an invalid location.
23 lines
502 B
Ruby
23 lines
502 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Clover
|
|
hash_branch(:project_prefix, "private-subnet") do |r|
|
|
r.get true do
|
|
private_subnet_list
|
|
end
|
|
|
|
r.web do
|
|
r.post true do
|
|
check_visible_location
|
|
private_subnet_post(r.params["name"])
|
|
end
|
|
|
|
r.get "create" do
|
|
authorize("PrivateSubnet:create", @project.id)
|
|
@option_tree, @option_parents = generate_private_subnet_options
|
|
view "networking/private_subnet/create"
|
|
end
|
|
end
|
|
end
|
|
end
|