Browse Source

Fix failing tests expecting an empty hash

pull/2499/head
Manny Dinssa 2 years ago
parent
commit
c74c842dfa
  1. 2
      app/models/form/lettings/questions/location_id.rb
  2. 2
      app/models/form/lettings/questions/location_id_search.rb

2
app/models/form/lettings/questions/location_id.rb

@ -35,7 +35,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question
name = v["hint"].match(/[a-zA-Z].*/).to_s
number = v["hint"].match(/\d+/).to_s.to_i
[name, number]
end
end.to_h
end
def hidden_in_check_answers?(lettings_log, _current_user = nil)

2
app/models/form/lettings/questions/location_id_search.rb

@ -31,7 +31,7 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question
return {} unless lettings_log.scheme
scheme_location_ids = lettings_log.scheme.locations.visible.confirmed.pluck(:id)
answer_options.select { |k, _v| scheme_location_ids.include?(k.to_i) }
answer_options.select { |k, _v| scheme_location_ids.include?(k.to_i) }.to_h
end
def hidden_in_check_answers?(lettings_log, _current_user = nil)

Loading…
Cancel
Save