From bb6266a50ce96b93fd211a8cc4790ad8fb789b75 Mon Sep 17 00:00:00 2001 From: Michael Oleske Date: Thu, 4 Aug 2022 23:43:24 +0000 Subject: [PATCH] Switch route to /routes/:guid/relationships/space - pr feedback Co-authored-by: Michael Oleske Co-authored-by: David Alvarado --- config/routes.rb | 2 +- spec/request/routes_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 706dc941f88..7e211a5f131 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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' diff --git a/spec/request/routes_spec.rb b/spec/request/routes_spec.rb index 0123ab5ff40..e68ac754b85 100644 --- a/spec/request/routes_spec.rb +++ b/spec/request/routes_spec.rb @@ -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 { @@ -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(