Browse Source

CLDC-3456: Fix bug preventing location_id from counting as a location qusetion (#2417)

pull/2422/head v0.4.40
Rachael Booth 8 months ago committed by GitHub
parent
commit
4455e6adf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/models/lettings_log.rb
  2. 2
      spec/models/lettings_log_spec.rb

2
app/models/lettings_log.rb

@ -575,7 +575,7 @@ class LettingsLog < Log
def non_location_setup_questions_completed?
form.setup_sections.all? do |section|
section.subsections.all? do |subsection|
relevant_qs = subsection.applicable_questions(self).reject { |q| optional_fields.include?(q.id) || %w[scheme_id location].include?(q.id) }
relevant_qs = subsection.applicable_questions(self).reject { |q| optional_fields.include?(q.id) || %w[scheme_id location_id].include?(q.id) }
relevant_qs.all? do |question|
question.completed?(self)
end

2
spec/models/lettings_log_spec.rb

@ -3549,7 +3549,7 @@ RSpec.describe LettingsLog do
end
context "when scheme and location have not been completed" do
let(:lettings_log) { build(:lettings_log, :setup_completed, :sh, scheme_id: nil, location: nil) }
let(:lettings_log) { build(:lettings_log, :setup_completed, :sh, scheme_id: nil, location_id: nil) }
it "returns true" do
expect(lettings_log).to be_non_location_setup_questions_completed

Loading…
Cancel
Save