@ -190,8 +190,6 @@ RSpec.describe Form, type: :model do
FormHandler . instance . use_real_forms!
FormHandler . instance . use_real_forms!
example . run
example . run
FormHandler . instance . use_fake_forms!
end
end
it " finds the path to the section after " do
it " finds the path to the section after " do
@ -202,6 +200,21 @@ RSpec.describe Form, type: :model do
expect ( form . next_incomplete_section_redirect_path ( subsection , lettings_log ) ) . to eq ( " joint " )
expect ( form . next_incomplete_section_redirect_path ( subsection , lettings_log ) ) . to eq ( " joint " )
end
end
end
end
context " when a log has status in progress but all subsections are complete " do
let ( :lettings_log ) { build ( :lettings_log , :completed , status : " in_progress " ) }
let ( :subsection ) { form . get_subsection ( " setup " ) }
around do | example |
FormHandler . instance . use_real_forms!
example . run
end
it " should not raise a Stack Error " do
expect { form . next_incomplete_section_redirect_path ( subsection , lettings_log ) } . not_to raise_error
end
end
end
end
describe " # reset_not_routed_questions_and_invalid_answers " do
describe " # reset_not_routed_questions_and_invalid_answers " do