| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -104,13 +104,13 @@ RSpec.describe "Test Features" do | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    context "when the user needs to check their answers for a subsection" do | 
					 | 
					 | 
					 | 
					    context "when the user needs to check their answers for a subsection" do | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      def fill_in_number_question(case_log_id, question, value) | 
					 | 
					 | 
					 | 
					      def fill_in_number_question(case_log_id, question, value) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        visit("/case_logs/#{case_log_id}/#{question}") | 
					 | 
					 | 
					 | 
					        visit("/case_logs/#{case_log_id}/#{question}") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        fill_in("#{question}", with: value) | 
					 | 
					 | 
					 | 
					        fill_in(question.to_s, with: value) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        click_button("Save and continue") | 
					 | 
					 | 
					 | 
					        click_button("Save and continue") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      end | 
					 | 
					 | 
					 | 
					      end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      def answer_all_questions_in_income_subsection | 
					 | 
					 | 
					 | 
					      def answer_all_questions_in_income_subsection | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        visit("/case_logs/#{empty_case_log.id}/net_income") | 
					 | 
					 | 
					 | 
					        visit("/case_logs/#{empty_case_log.id}/net_income") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        fill_in("net_income", with: 18000) | 
					 | 
					 | 
					 | 
					        fill_in("net_income", with: 18_000) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        choose("net-income-frequency-yearly-field") | 
					 | 
					 | 
					 | 
					        choose("net-income-frequency-yearly-field") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        click_button("Save and continue") | 
					 | 
					 | 
					 | 
					        click_button("Save and continue") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        choose("net-income-uc-proportion-all-field") | 
					 | 
					 | 
					 | 
					        choose("net-income-uc-proportion-all-field") | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -151,7 +151,7 @@ RSpec.describe "Test Features" do | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        visit("case_logs/#{empty_case_log.id}/#{subsection}/check_answers") | 
					 | 
					 | 
					 | 
					        visit("case_logs/#{empty_case_log.id}/#{subsection}/check_answers") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        assert_selector "a", text: /Answer\z/, count: 7 | 
					 | 
					 | 
					 | 
					        assert_selector "a", text: /Answer\z/, count: 7 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        assert_selector "a", text: "Change", count: 0 | 
					 | 
					 | 
					 | 
					        assert_selector "a", text: "Change", count: 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        expect(page).to have_link('Answer', href: "/case_logs/#{empty_case_log.id}/tenant_age") | 
					 | 
					 | 
					 | 
					        expect(page).to have_link("Answer", href: "/case_logs/#{empty_case_log.id}/tenant_age") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      end | 
					 | 
					 | 
					 | 
					      end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      it "should have a change link for answered questions" do | 
					 | 
					 | 
					 | 
					      it "should have a change link for answered questions" do | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -159,26 +159,26 @@ RSpec.describe "Test Features" do | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        visit("/case_logs/#{empty_case_log.id}/#{subsection}/check_answers") | 
					 | 
					 | 
					 | 
					        visit("/case_logs/#{empty_case_log.id}/#{subsection}/check_answers") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        assert_selector "a", text: /Answer\z/, count: 6 | 
					 | 
					 | 
					 | 
					        assert_selector "a", text: /Answer\z/, count: 6 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        assert_selector "a", text: "Change", count: 1 | 
					 | 
					 | 
					 | 
					        assert_selector "a", text: "Change", count: 1 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        expect(page).to have_link('Change', href: "/case_logs/#{empty_case_log.id}/tenant_age") | 
					 | 
					 | 
					 | 
					        expect(page).to have_link("Change", href: "/case_logs/#{empty_case_log.id}/tenant_age") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      end | 
					 | 
					 | 
					 | 
					      end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      it "should have a link pointing to the first question if no questions are answered" do | 
					 | 
					 | 
					 | 
					      it "should have a link pointing to the first question if no questions are answered" do | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        visit("/case_logs/#{empty_case_log.id}/#{subsection}/check_answers") | 
					 | 
					 | 
					 | 
					        visit("/case_logs/#{empty_case_log.id}/#{subsection}/check_answers") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        expect(page).to have_content('You answered 0 of 7 questions') | 
					 | 
					 | 
					 | 
					        expect(page).to have_content("You answered 0 of 7 questions") | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        expect(page).to have_link('Answer the missing questions', href: "/case_logs/#{empty_case_log.id}/tenant_code") | 
					 | 
					 | 
					 | 
					        expect(page).to have_link("Answer the missing questions", href: "/case_logs/#{empty_case_log.id}/tenant_code") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      end | 
					 | 
					 | 
					 | 
					      end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      it "should have a link pointing to the next empty question if some questions are answered" do | 
					 | 
					 | 
					 | 
					      it "should have a link pointing to the next empty question if some questions are answered" do | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        fill_in_number_question(empty_case_log.id, "net_income", 18000) | 
					 | 
					 | 
					 | 
					        fill_in_number_question(empty_case_log.id, "net_income", 18_000) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        visit("/case_logs/#{empty_case_log.id}/income_and_benefits/check_answers") | 
					 | 
					 | 
					 | 
					        visit("/case_logs/#{empty_case_log.id}/income_and_benefits/check_answers") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        expect(page).to have_content('You answered 1 of 4 questions') | 
					 | 
					 | 
					 | 
					        expect(page).to have_content("You answered 1 of 4 questions") | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        expect(page).to have_link('Answer the missing questions', href: "/case_logs/#{empty_case_log.id}/net_income") | 
					 | 
					 | 
					 | 
					        expect(page).to have_link("Answer the missing questions", href: "/case_logs/#{empty_case_log.id}/net_income") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      end | 
					 | 
					 | 
					 | 
					      end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      it "should not display the missing answer questions link if all questions are answered" do | 
					 | 
					 | 
					 | 
					      it "should not display the missing answer questions link if all questions are answered" do | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        answer_all_questions_in_income_subsection | 
					 | 
					 | 
					 | 
					        answer_all_questions_in_income_subsection | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        expect(page).to have_content('You answered all the questions') | 
					 | 
					 | 
					 | 
					        expect(page).to have_content("You answered all the questions") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        assert_selector "a", text: "Answer the missing questions", count: 0 | 
					 | 
					 | 
					 | 
					        assert_selector "a", text: "Answer the missing questions", count: 0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      end | 
					 | 
					 | 
					 | 
					      end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    end | 
					 | 
					 | 
					 | 
					    end | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |