|
|
|
@ -41,6 +41,7 @@ RSpec.describe "Task List" do |
|
|
|
end |
|
|
|
end |
|
|
|
let(:id) { lettings_log.id } |
|
|
|
let(:id) { lettings_log.id } |
|
|
|
let(:status) { lettings_log.status } |
|
|
|
let(:status) { lettings_log.status } |
|
|
|
|
|
|
|
let(:real_2021_2022_form) { Form.new("config/forms/2021_2022.json") } |
|
|
|
|
|
|
|
|
|
|
|
around do |example| |
|
|
|
around do |example| |
|
|
|
Timecop.freeze(Time.zone.local(2022, 1, 1)) do |
|
|
|
Timecop.freeze(Time.zone.local(2022, 1, 1)) do |
|
|
|
@ -55,6 +56,7 @@ RSpec.describe "Task List" do |
|
|
|
Timecop.freeze(Time.zone.local(2021, 5, 1)) |
|
|
|
Timecop.freeze(Time.zone.local(2021, 5, 1)) |
|
|
|
setup_completed_log.update!(startdate: Time.zone.local(2021, 5, 1)) |
|
|
|
setup_completed_log.update!(startdate: Time.zone.local(2021, 5, 1)) |
|
|
|
allow(lettings_log.form).to receive(:end_date).and_return(Time.zone.today + 1.day) |
|
|
|
allow(lettings_log.form).to receive(:end_date).and_return(Time.zone.today + 1.day) |
|
|
|
|
|
|
|
allow(FormHandler.instance).to receive(:get_form).and_return(real_2021_2022_form) |
|
|
|
sign_in user |
|
|
|
sign_in user |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -69,7 +71,7 @@ RSpec.describe "Task List" do |
|
|
|
|
|
|
|
|
|
|
|
it "shows number of completed sections if one section is completed" do |
|
|
|
it "shows number of completed sections if one section is completed" do |
|
|
|
visit("/lettings-logs/#{setup_completed_log.id}") |
|
|
|
visit("/lettings-logs/#{setup_completed_log.id}") |
|
|
|
expect(page).to have_content("1 of 8 subsections completed.") |
|
|
|
expect(page).to have_content("1 of 7 subsections completed.") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "show skip link for next incomplete section" do |
|
|
|
it "show skip link for next incomplete section" do |
|
|
|
|