Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit ee681c6

Browse files
author
Brian Butz
committed
v3(services): duplicate route service binding should return 422
[#174085457](https://www.pivotaltracker.com/story/show/174085457)
1 parent ad1855e commit ee681c6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/controllers/v3/service_route_bindings_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ def route_services_disabled!
8383
end
8484

8585
def already_exists!
86-
raise CloudController::Errors::ApiError.new_from_details('ServiceInstanceAlreadyBoundToSameRoute')
86+
raise CloudController::Errors::ApiError.new_from_details('ServiceInstanceAlreadyBoundToSameRoute').with_response_code(422)
8787
end
8888
end

spec/request/service_route_bindings_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196

197197
it 'fails with a specific error' do
198198
api_call.call(space_dev_headers)
199-
expect(last_response).to have_status_code(400)
199+
expect(last_response).to have_status_code(422)
200200

201201
expect(parsed_response['errors']).to include(
202202
include({

0 commit comments

Comments
 (0)