|
|
@ -3,7 +3,6 @@ require "rails_helper" |
|
|
|
RSpec.describe TasklistHelper do |
|
|
|
RSpec.describe TasklistHelper do |
|
|
|
describe "get subsection status" do |
|
|
|
describe "get subsection status" do |
|
|
|
let!(:case_log) { FactoryBot.create(:case_log) } |
|
|
|
let!(:case_log) { FactoryBot.create(:case_log) } |
|
|
|
@form = Form.new(2021, 2022) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "returns not started if none of the questions in the subsection are answered" do |
|
|
|
it "returns not started if none of the questions in the subsection are answered" do |
|
|
|
expect(get_subsection_status("income_and_benefits", case_log)).to eq(:not_started) |
|
|
|
expect(get_subsection_status("income_and_benefits", case_log)).to eq(:not_started) |
|
|
@ -28,4 +27,19 @@ RSpec.describe TasklistHelper do |
|
|
|
expect(get_subsection_status("declaration", completed_case_log)).to eq(:not_started) |
|
|
|
expect(get_subsection_status("declaration", completed_case_log)).to eq(:not_started) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe "get next incomplete section" do |
|
|
|
|
|
|
|
let!(:case_log) { FactoryBot.create(:case_log) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "returns the first subsection name if it is not completed" do |
|
|
|
|
|
|
|
@form = Form.new(2021, 2022) |
|
|
|
|
|
|
|
expect(get_next_incomplete_section(@form, case_log)).to eq("household_characteristics") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "returns the first subsection name if it is partially completed" do |
|
|
|
|
|
|
|
@form = Form.new(2021, 2022) |
|
|
|
|
|
|
|
case_log["tenant_code"] = 123 |
|
|
|
|
|
|
|
expect(get_next_incomplete_section(@form, case_log)).to eq("household_characteristics") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|