@ -26,7 +26,7 @@ RSpec.describe Validations::PropertyValidations do
let(:subject) { subject_class.new }
let(:subject_class) { Class.new { include Validations::PropertyValidations } }
let(:record) { FactoryBot.create(:case_log) }
let(:expected_error) { "Number of times property has been offered for relet must be a number between 0 and 20" }
let(:expected_error) { I18n.t("validations.property.offered.relet_number") }
describe "#validate_property_number_of_times_relet" do
it "does not add an error if the record offered is missing" do
@ -72,7 +72,7 @@ RSpec.describe CaseLogsController, type: :request do
it "validates case log parameters" do
json_response = JSON.parse(response.body)
expect(response).to have_http_status(:unprocessable_entity)
expect(json_response["errors"]).to match_array([["offered", ["Number of times property has been offered for relet must be a number between 0 and 20"]], ["age1", ["Tenant age must be an integer between 16 and 120"]]])
expect(json_response["errors"]).to match_array([["offered", [I18n.t("validations.property.offered.relet_number")]], ["age1", [I18n.t("validations.household.age.must_be_valid", lower_bound: 16)]]])
end