Browse Source

Fix specs after merge

pull/219/head
baarkerlounger 3 years ago
parent
commit
155a5f0d45
  1. 2
      spec/models/validations/property_validations_spec.rb
  2. 2
      spec/requests/case_log_controller_spec.rb

2
spec/models/validations/property_validations_spec.rb

@ -26,7 +26,7 @@ RSpec.describe Validations::PropertyValidations do
let(:subject) { subject_class.new } let(:subject) { subject_class.new }
let(:subject_class) { Class.new { include Validations::PropertyValidations } } let(:subject_class) { Class.new { include Validations::PropertyValidations } }
let(:record) { FactoryBot.create(:case_log) } 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 describe "#validate_property_number_of_times_relet" do
it "does not add an error if the record offered is missing" do it "does not add an error if the record offered is missing" do

2
spec/requests/case_log_controller_spec.rb

@ -72,7 +72,7 @@ RSpec.describe CaseLogsController, type: :request do
it "validates case log parameters" do it "validates case log parameters" do
json_response = JSON.parse(response.body) json_response = JSON.parse(response.body)
expect(response).to have_http_status(:unprocessable_entity) 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 end
end end

Loading…
Cancel
Save