diff --git a/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/power_of_attorney_requests.rb b/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/power_of_attorney_requests.rb index faa3593b8b8..f3c3c3bae6a 100644 --- a/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/power_of_attorney_requests.rb +++ b/modules/accredited_representative_portal/app/controllers/concerns/accredited_representative_portal/power_of_attorney_requests.rb @@ -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 diff --git a/modules/accredited_representative_portal/spec/requests/accredited_representative_portal/v0/power_of_attorney_requests_spec.rb b/modules/accredited_representative_portal/spec/requests/accredited_representative_portal/v0/power_of_attorney_requests_spec.rb index 61e01dc1496..f6bf7882149 100644 --- a/modules/accredited_representative_portal/spec/requests/accredited_representative_portal/v0/power_of_attorney_requests_spec.rb +++ b/modules/accredited_representative_portal/spec/requests/accredited_representative_portal/v0/power_of_attorney_requests_spec.rb @@ -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) @@ -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