Browse Source

Rubocop offenses

pull/470/head
Stéphane Meny 3 years ago
parent
commit
482f137cda
No known key found for this signature in database
GPG Key ID: 9D0AFEA988527923
  1. 4
      app/models/case_log.rb
  2. 2
      spec/models/validations/household_validations_spec.rb
  3. 2
      spec/models/validations/tenancy_validations_spec.rb
  4. 1
      spec/services/imports/case_logs_import_service_spec.rb

4
app/models/case_log.rb

@ -162,12 +162,12 @@ class CaseLog < ApplicationRecord
def is_supported_housing? def is_supported_housing?
# 0: Supported Housing # 0: Supported Housing
!!(needstype&.zero?) !!needstype&.zero?
end end
def has_hbrentshortfall? def has_hbrentshortfall?
# 0: Yes # 0: Yes
!!(hbrentshortfall&.zero?) !!hbrentshortfall&.zero?
end end
def postcode_known? def postcode_known?

2
spec/models/validations/household_validations_spec.rb

@ -238,7 +238,7 @@ RSpec.describe Validations::HouseholdValidations do
describe "armed forces validations" do describe "armed forces validations" do
context "when the tenant or partner was and is not a member of the armed forces" do context "when the tenant or partner was and is not a member of the armed forces" do
it "validates that injured in the armed forces is not yes" do it "validates that injured in the armed forces is not yes" do
record.armedforces = 3 record.armedforces = 2
record.reservist = 0 record.reservist = 0
household_validator.validate_armed_forces(record) household_validator.validate_armed_forces(record)
expect(record.errors["reservist"]) expect(record.errors["reservist"])

2
spec/models/validations/tenancy_validations_spec.rb

@ -22,6 +22,7 @@ RSpec.describe Validations::TenancyValidations do
context "when type of tenancy is assured shorthold" do context "when type of tenancy is assured shorthold" do
let(:expected_error) { I18n.t("validations.tenancy.length.shorthold") } let(:expected_error) { I18n.t("validations.tenancy.length.shorthold") }
before { record.tenancy = 4 } before { record.tenancy = 4 }
context "when tenancy length is greater than 1" do context "when tenancy length is greater than 1" do
@ -63,6 +64,7 @@ RSpec.describe Validations::TenancyValidations do
context "when type of tenancy is secure" do context "when type of tenancy is secure" do
let(:expected_error) { I18n.t("validations.tenancy.length.secure") } let(:expected_error) { I18n.t("validations.tenancy.length.secure") }
before { record.tenancy = 1 } before { record.tenancy = 1 }
context "when tenancy length is greater than 1" do context "when tenancy length is greater than 1" do

1
spec/services/imports/case_logs_import_service_spec.rb

@ -24,7 +24,6 @@ RSpec.describe Imports::CaseLogsImportService do
it "successfully create a case log with the expected data" do it "successfully create a case log with the expected data" do
case_log_service.create_logs(remote_folder) case_log_service.create_logs(remote_folder)
end end
end end
end end

Loading…
Cancel
Save