Browse Source

Another attempt at logging validation error

pull/207/head
Stéphane Meny 3 years ago
parent
commit
53bb9ce1ef
No known key found for this signature in database
GPG Key ID: 9D0AFEA988527923
  1. 1
      app/models/validations/financial_validations.rb
  2. 4
      spec/requests/case_log_controller_spec.rb

1
app/models/validations/financial_validations.rb

@ -31,6 +31,7 @@ module Validations::FinancialValidations
end
if record.weekly_net_income < record.applicable_income_range.hard_min
pp record
record.errors.add :earnings, "Net income cannot be less than #{record.applicable_income_range.hard_min} given the tenant's working situation"
end
end

4
spec/requests/case_log_controller_spec.rb

@ -100,10 +100,6 @@ RSpec.describe CaseLogsController, type: :request do
it "marks the record as completed" do
json_response = JSON.parse(response.body)
pp headers
pp params
pp json_response
expect(json_response).not_to have_key("errors")
expect(json_response["status"]).to eq(completed)
end

Loading…
Cancel
Save