expect(page).tohave_content("Q1 - Friday 12 July 2024")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 6 June 2025.")
context"when visiting during the current collection year"do
expect(page).tohave_content("Q2 - Friday 11 October 2024")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 6 June 2025.")
find("span.govuk-details__summary-text",text:"Quarterly cut-off dates for 2024 to 2025").click
expect(page).tohave_content("Q1 - Friday 12 July 2024")
expect(page).tohave_content("Q2 - Friday 11 October 2024")
expect(page).tohave_content("Q3 - Friday 10 January 2025")
expect(page).tohave_content("End of year deadline - Friday 6 June 2025")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 6 June 2025.")
expect(page).tohave_content("Q3 - Friday 10 January 2025")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 6 June 2025.")
scenario"displays correct current quarter as Q1"do
expect(page).tohave_selector("h1.govuk-heading-l + p.govuk-body.govuk-body-m",text:"Q1 - Friday 12 July 2024: Quarterly cut off date for tenancies and sales starting between 1 April 2024 and 30 June 2024.")
expect(page).tohave_content("Q1 - Friday 12 July 2024")
expect(page).tohave_content("End of year deadline - Friday 6 June 2025")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 6 June 2025.")
scenario"displays correct current quarter as Q2"do
expect(page).tohave_selector("h1.govuk-heading-l + p.govuk-body.govuk-body-m",text:"Q2 - Friday 11 October 2024: Quarterly cut off date for tenancies and sales starting between 1 July 2024 and 30 September 2024.")
expect(page).tohave_content("Q2 - Friday 11 October 2024")
end
Timecop.return
end
end
end
context"when visiting during the next collection year"do
expect(page).tohave_selector("h1.govuk-heading-l + p.govuk-body.govuk-body-m",text:"Q3 - Friday 10 January 2025: Quarterly cut off date for tenancies and sales starting between 1 October 2024 and 31 December 2024.")
expect(page).tohave_content("Q3 - Friday 10 January 2025")
end
Timecop.return
end
end
after{travel_back}
context"when visiting during the next collection year"do
expect(page).tohave_content("Q1 - Friday 11 July 2025")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 5 June 2026.")
find("span.govuk-details__summary-text",text:"Quarterly cut-off dates for 2025 to 2026").click
expect(page).tohave_content("Q1 - Friday 11 July 2025")
expect(page).tohave_content("Q2 - Friday 10 October 2025")
expect(page).tohave_content("Q3 - Friday 16 January 2026")
expect(page).tohave_content("End of year deadline - Friday 5 June 2026")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 5 June 2026.")
expect(page).tohave_content("Q2 - Friday 10 October 2025")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 5 June 2026.")
scenario"displays correct current quarter as Q1"do
expect(page).tohave_selector("h1.govuk-heading-l + p.govuk-body.govuk-body-m",text:"Q1 - Friday 11 July 2025: Quarterly cut off date for tenancies and sales starting between 1 April 2025 and 30 June 2025.")
expect(page).tohave_content("Q1 - Friday 11 July 2025")
expect(page).tohave_content("Q3 - Friday 16 January 2026")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 5 June 2026.")
scenario"displays correct current quarter as Q2"do
expect(page).tohave_selector("h1.govuk-heading-l + p.govuk-body.govuk-body-m",text:"Q2 - Friday 10 October 2025: Quarterly cut off date for tenancies and sales starting between 1 July 2025 and 30 September 2025.")
expect(page).tohave_content("Q2 - Friday 10 October 2025")
expect(page).tohave_content("End of year deadline - Friday 5 June 2026")
expect(page).tohave_content("You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: Friday 5 June 2026.")
scenario"displays correct current quarter as Q3"do
expect(page).tohave_selector("h1.govuk-heading-l + p.govuk-body.govuk-body-m",text:"Q3 - Friday 16 January 2026: Quarterly cut off date for tenancies and sales starting between 1 October 2025 and 31 December 2025.")
expect(page).tohave_content("Q3 - Friday 16 January 2026")