Skip to content

Commit

Permalink
Update bad request error, specs
Browse files Browse the repository at this point in the history
  • Loading branch information
pixiitech committed Jan 21, 2025
1 parent 0177441 commit edafbb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ module PowerOfAttorneyRequests
)
end

rescue_from Common::Exceptions::BadRequest do |e|
rescue_from ActionController::BadRequest do |e|
render(
json: { errors: e.errors },
json: { errors: [e.message] },
status: :bad_request
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ def load_response_fixture(path_suffix)
end

before do
AccreditedRepresentativePortal::PowerOfAttorneyForm.delete_all
AccreditedRepresentativePortal::PowerOfAttorneyRequestResolution.delete_all
AccreditedRepresentativePortal::PowerOfAttorneyRequest.delete_all
Flipper.enable(:accredited_representative_portal_pilot)
login_as(test_user)
travel_to(time)
Expand Down Expand Up @@ -207,7 +204,7 @@ def load_response_fixture(path_suffix)

it 'throws an error if any other status filter provided' do
get('/accredited_representative_portal/v0/power_of_attorney_requests?status=delete_all')
expect(response).to have_http_status(:internal_server_error)
expect(response).to have_http_status(:bad_request)
end
end
end
Expand Down

0 comments on commit edafbb1

Please sign in to comment.