@ -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
@ -3549,7 +3549,7 @@ RSpec.describe LettingsLog do
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