Skip to content

Commit

Permalink
v3(services): duplicate route service binding should return 422
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Butz committed Aug 24, 2020
1 parent ad1855e commit ee681c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/v3/service_route_bindings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ def route_services_disabled!
end

def already_exists!
raise CloudController::Errors::ApiError.new_from_details('ServiceInstanceAlreadyBoundToSameRoute')
raise CloudController::Errors::ApiError.new_from_details('ServiceInstanceAlreadyBoundToSameRoute').with_response_code(422)
end
end
2 changes: 1 addition & 1 deletion spec/request/service_route_bindings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@

it 'fails with a specific error' do
api_call.call(space_dev_headers)
expect(last_response).to have_status_code(400)
expect(last_response).to have_status_code(422)

expect(parsed_response['errors']).to include(
include({
Expand Down

0 comments on commit ee681c6

Please sign in to comment.