Skip to content

Commit

Permalink
Switch route to /routes/:guid/relationships/space
Browse files Browse the repository at this point in the history
- pr feedback

Co-authored-by: Michael Oleske <[email protected]>
Co-authored-by: David Alvarado <[email protected]>
  • Loading branch information
moleske and dalvarado committed Aug 4, 2022
1 parent 2cf0cfc commit bb6266a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
post '/routes/:guid/relationships/shared_spaces', to: 'routes#share_routes'
delete '/routes/:guid/relationships/shared_spaces/:space_guid', to: 'routes#unshare_route'
get '/routes/:guid/relationships/shared_spaces', to: 'routes#relationships_shared_routes'
patch '/routes/:guid/transfer_owner', to: 'routes#transfer_owner'
patch '/routes/:guid/relationships/space', to: 'routes#transfer_owner'
patch '/routes/:guid', to: 'routes#update'
delete '/routes/:guid', to: 'routes#destroy'
get '/apps/:guid/routes', to: 'routes#index_by_app'
Expand Down
6 changes: 3 additions & 3 deletions spec/request/routes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3207,10 +3207,10 @@
end
end

describe 'PATCH /v3/routes/:guid/transfer_owner' do
describe 'PATCH /v3/routes/:guid/relationships/space' do
let(:shared_domain) { VCAP::CloudController::SharedDomain.make }
let(:route) { VCAP::CloudController::Route.make(space: space, domain: shared_domain) }
let(:api_call) { lambda { |user_headers| patch "/v3/routes/#{route.guid}/transfer_owner", request_body.to_json, user_headers } }
let(:api_call) { lambda { |user_headers| patch "/v3/routes/#{route.guid}/relationships/space", request_body.to_json, user_headers } }
let(:target_space) { VCAP::CloudController::Space.make(organization: org) }
let(:request_body) do
{
Expand Down Expand Up @@ -3385,7 +3385,7 @@
end

it 'responds with 404 when the route does not exist' do
patch '/v3/routes/some-fake-guid/transfer_owner', request_body.to_json, space_dev_headers
patch '/v3/routes/some-fake-guid/relationships/space', request_body.to_json, space_dev_headers

expect(last_response).to have_status_code(404)
expect(parsed_response['errors']).to include(
Expand Down

0 comments on commit bb6266a

Please sign in to comment.