diff --git a/app/models/form/common/questions/created_by_id.rb b/app/models/form/common/questions/created_by_id.rb index 3c3447951..ee2767a4f 100644 --- a/app/models/form/common/questions/created_by_id.rb +++ b/app/models/form/common/questions/created_by_id.rb @@ -24,7 +24,7 @@ class Form::Common::Questions::CreatedById < ::Form::Question answer_options.select { |k, _v| user_ids.include?(k) } end - def label_from_value(value, log = nil, user = nil) + def label_from_value(value, _log = nil, _user = nil) return unless value answer_options[value] diff --git a/app/models/form/common/questions/owning_organisation_id.rb b/app/models/form/common/questions/owning_organisation_id.rb index 13a7a33d1..14e262f58 100644 --- a/app/models/form/common/questions/owning_organisation_id.rb +++ b/app/models/form/common/questions/owning_organisation_id.rb @@ -21,7 +21,7 @@ class Form::Common::Questions::OwningOrganisationId < ::Form::Question answer_options end - def label_from_value(value, log = nil, user = nil) + def label_from_value(value, _log = nil, _user = nil) return unless value answer_options[value] diff --git a/app/models/form/lettings/questions/created_by_id.rb b/app/models/form/lettings/questions/created_by_id.rb index dbebce958..6402f14e0 100644 --- a/app/models/form/lettings/questions/created_by_id.rb +++ b/app/models/form/lettings/questions/created_by_id.rb @@ -27,7 +27,7 @@ class Form::Lettings::Questions::CreatedById < ::Form::Question answer_options.select { |k, _v| user_ids.include?(k) } end - def label_from_value(value, log = nil, user = nil) + def label_from_value(value, _log = nil, _user = nil) return unless value answer_options[value] diff --git a/app/models/form/lettings/questions/managing_organisation.rb b/app/models/form/lettings/questions/managing_organisation.rb index 6673aa1b8..e2e3b3e3d 100644 --- a/app/models/form/lettings/questions/managing_organisation.rb +++ b/app/models/form/lettings/questions/managing_organisation.rb @@ -18,7 +18,7 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question return opts unless log if log.managing_organisation.present? - opts = opts.merge({ log.managing_organisation.id => log.managing_organisation.name} ) + opts = opts.merge({ log.managing_organisation.id => log.managing_organisation.name }) end if current_user.support? diff --git a/app/models/form/lettings/questions/stock_owner.rb b/app/models/form/lettings/questions/stock_owner.rb index 29aba5963..dfc2209c3 100644 --- a/app/models/form/lettings/questions/stock_owner.rb +++ b/app/models/form/lettings/questions/stock_owner.rb @@ -28,7 +28,7 @@ class Form::Lettings::Questions::StockOwner < ::Form::Question answer_options end - def label_from_value(value, log = nil, user = nil) + def label_from_value(value, _log = nil, _user = nil) return unless value answer_options[value] diff --git a/app/models/form/question.rb b/app/models/form/question.rb index b5090fd84..cbfc6aae2 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -151,7 +151,7 @@ class Form::Question end end - def label_from_value(value, log = nil, user = nil) + def label_from_value(value, _log = nil, _user = nil) return unless value label = case type diff --git a/spec/models/form/lettings/questions/managing_organisation_spec.rb b/spec/models/form/lettings/questions/managing_organisation_spec.rb index f8d7ae8e4..97a1b179c 100644 --- a/spec/models/form/lettings/questions/managing_organisation_spec.rb +++ b/spec/models/form/lettings/questions/managing_organisation_spec.rb @@ -93,10 +93,10 @@ RSpec.describe Form::Lettings::Questions::ManagingOrganisation, type: :model do end it "shows current managing agent at top, followed by the current owning organisation (with hint), followed by the managing agents of the current owning organisation" do - log_owning_org.update(holds_own_stock: true) + log_owning_org.update!(holds_own_stock: true) expect(question.displayed_answer_options(log, user)).to eq(options) end - end + end context "when org does not own stock" do let(:options) do @@ -109,7 +109,7 @@ RSpec.describe Form::Lettings::Questions::ManagingOrganisation, type: :model do end it "shows current managing agent at top, followed by the managing agents of the current owning organisation" do - log_owning_org.update(holds_own_stock: false) + log_owning_org.update!(holds_own_stock: false) expect(question.displayed_answer_options(log, user)).to eq(options) end end @@ -135,7 +135,6 @@ RSpec.describe Form::Lettings::Questions::ManagingOrganisation, type: :model do expect(question.displayed_answer_options(log, user)).to eq(options) end end - end it "is marked as derived" do