|
|
|
|
@ -42,38 +42,16 @@ RSpec.describe "Task List" do
|
|
|
|
|
let(:id) { lettings_log.id } |
|
|
|
|
let(:status) { lettings_log.status } |
|
|
|
|
|
|
|
|
|
around do |example| |
|
|
|
|
Timecop.freeze(Time.zone.local(2022, 1, 1)) do |
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
example.run |
|
|
|
|
end |
|
|
|
|
Timecop.return |
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
Timecop.freeze(Time.zone.local(2021, 5, 1)) |
|
|
|
|
setup_completed_log.update!(startdate: Time.zone.local(2021, 5, 1)) |
|
|
|
|
allow(lettings_log.form).to receive(:new_logs_end_date).and_return(Time.zone.today + 1.day) |
|
|
|
|
sign_in user |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
after do |
|
|
|
|
Timecop.unfreeze |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "shows if the section has not been started" do |
|
|
|
|
visit("/lettings-logs/#{empty_lettings_log.id}") |
|
|
|
|
expect(page).to have_content("This log has not been started.") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "completed subsection count" do |
|
|
|
|
let(:real_2021_2022_form) { Form.new("config/forms/2021_2022.json") } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
allow(FormHandler.instance).to receive(:get_form).and_return(real_2021_2022_form) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "shows number of completed sections if one section is completed" do |
|
|
|
|
visit("/lettings-logs/#{setup_completed_log.id}") |
|
|
|
|
expect(page).to have_content("1 of 7 subsections completed.") |
|
|
|
|
@ -81,9 +59,8 @@ RSpec.describe "Task List" do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "show skip link for next incomplete section" do |
|
|
|
|
answer_all_questions_in_income_subsection(setup_completed_log) |
|
|
|
|
visit("/lettings-logs/#{setup_completed_log.id}") |
|
|
|
|
expect(page).to have_link("Skip to next incomplete section", href: /#household-characteristics/) |
|
|
|
|
expect(page).to have_link("Skip to next incomplete section", href: /#property-information/) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has a review section which has a button that allows the data inputter to review the lettings log" do |
|
|
|
|
|