|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
require "rails_helper" |
|
|
|
|
|
|
|
|
|
RSpec.describe CheckAnswersHelper do |
|
|
|
|
describe "Get answered questions total" do |
|
|
|
|
let!(:case_log) { FactoryBot.create(:case_log) } |
|
|
|
|
@form = Form.new(2021, 2022) |
|
|
|
|
subsection_pages = @form.pages_for_subsection("income_and_benefits") |
|
|
|
|
let(:case_log) { FactoryBot.create(:case_log) } |
|
|
|
|
let(:form) { Form.new(2021, 2022) } |
|
|
|
|
let(:subsection_pages) { form.pages_for_subsection("income_and_benefits") } |
|
|
|
|
|
|
|
|
|
describe "Get answered questions total" do |
|
|
|
|
it "returns 0 if no questions are answered" do |
|
|
|
|
expect(get_answered_questions_total(subsection_pages, case_log)).to equal(0) |
|
|
|
|
end |
|
|
|
@ -17,10 +17,6 @@ RSpec.describe CheckAnswersHelper do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "Get total number of questions" do |
|
|
|
|
let!(:case_log) { FactoryBot.create(:case_log) } |
|
|
|
|
@form = Form.new(2021, 2022) |
|
|
|
|
subsection_pages = @form.pages_for_subsection("income_and_benefits") |
|
|
|
|
|
|
|
|
|
it "returns the total number of questions for a subsection" do |
|
|
|
|
expect(get_total_number_of_questions(subsection_pages)).to eq(4) |
|
|
|
|
end |
|
|
|
|