Skip to content

Commit

Permalink
when vers is less than db - bad request
Browse files Browse the repository at this point in the history
  • Loading branch information
SaravShah committed Apr 16, 2018
1 parent a258705 commit f9e909a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def update
:not_found # 404
elsif poh.handler_results.contains_result_code?(:invalid_arguments)
:not_acceptable # 406
elsif poh.handler_results.contains_result_code?(:actual_vers_lt_db_obj)
:bad_request # 400
else
:internal_server_error # 500 including :unexpected_version, :pc_po_version_mismatch, :db_update_failed
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
end

it 'returns an internal server error' do
expect(response).to have_http_status(:internal_server_error)
expect(response).to have_http_status(:bad_request)
end
end

Expand Down

0 comments on commit f9e909a

Please sign in to comment.