Browse Source

Remove unused methods (#443)

* Remove unused methods

* Spec setting data protection officer status
pull/447/head
baarkerlounger 3 years ago committed by GitHub
parent
commit
9387a743da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      app/models/case_log.rb
  2. 11
      spec/models/user_spec.rb

16
app/models/case_log.rb

@ -124,10 +124,6 @@ class CaseLog < ApplicationRecord
net_income_in_soft_min_range? || net_income_in_soft_max_range?
end
def rent_in_soft_validation_range?
rent_in_soft_min_range? || rent_in_soft_max_range?
end
def given_reasonable_preference?
reasonpref == 1
end
@ -277,22 +273,10 @@ class CaseLog < ApplicationRecord
landlord == 1
end
def other_landlord?
landlord == 2
end
def is_prevten_la_general_needs?
[30, 31].any?(prevten)
end
def soft_min
LaRentRange.find_by(start_year: collection_start_year, la:, beds:, lettype:).soft_min
end
def soft_max
LaRentRange.find_by(start_year: collection_start_year, la:, beds:, lettype:).soft_max
end
def self.to_csv
CSV.generate(headers: true) do |csv|
csv << attribute_names

11
spec/models/user_spec.rb

@ -51,13 +51,18 @@ RSpec.describe User, type: :model do
expect(user.is_key_contact?).to be false
end
it "can be set to key contact" do
expect { user.is_key_contact! }
.to change { user.reload.is_key_contact? }.from(false).to(true)
end
it "is not a data protection officer by default" do
expect(user.is_data_protection_officer?).to be false
end
it "can be set to key contact" do
expect { user.is_key_contact! }
.to change { user.reload.is_key_contact? }.from(false).to(true)
it "can be set to data protection officer" do
expect { user.is_data_protection_officer! }
.to change { user.reload.is_data_protection_officer? }.from(false).to(true)
end
end

Loading…
Cancel
Save