From 51d7ef2937bfe888ab1cc968ecf167d44a530619 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Tue, 6 Feb 2024 11:03:37 +0000 Subject: [PATCH] feat: update tests --- spec/features/organisation_spec.rb | 8 ++++---- spec/helpers/filters_helper_spec.rb | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index 43c0a9d8e..f9bb8f450 100644 --- a/spec/features/organisation_spec.rb +++ b/spec/features/organisation_spec.rb @@ -196,9 +196,9 @@ RSpec.describe "User Features" do end it "can filter lettings logs by year" do - check("years-2021-field") + check("years-2022-field") click_button("Apply filters") - expect(page).to have_current_path("/organisations/#{org_id}/lettings-logs?years[]=&years[]=2021&status[]=&needstypes[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=") + expect(page).to have_current_path("/organisations/#{org_id}/lettings-logs?years[]=&years[]=2022&status[]=&needstypes[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=") expect(page).not_to have_link first_log.id.to_s, href: "/lettings-logs/#{first_log.id}" end @@ -241,9 +241,9 @@ RSpec.describe "User Features" do organisation.sales_logs.map(&:id).each do |sales_log_id| expect(page).to have_link sales_log_id.to_s, href: "/sales-logs/#{sales_log_id}" end - check("years-2021-field") + check("years-2022-field") click_button("Apply filters") - expect(page).to have_current_path("/organisations/#{org_id}/sales-logs?years[]=&years[]=2021&status[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=") + expect(page).to have_current_path("/organisations/#{org_id}/sales-logs?years[]=&years[]=2022&status[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=") expect(page).not_to have_link first_log.id.to_s, href: "/sales-logs/#{first_log.id}" end end diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb index 52a9595fc..a49d10661 100644 --- a/spec/helpers/filters_helper_spec.rb +++ b/spec/helpers/filters_helper_spec.rb @@ -251,7 +251,8 @@ RSpec.describe FiltersHelper do it "has the correct options" do expect(collection_year_options).to eq( { - "2023" => "2023/24", "2022" => "2022/23", "2021" => "2021/22" + # "2023" => "2023/24", "2022" => "2022/23", "2021" => "2021/22" revert to this after PO + "2024" => "2024/25", "2023" => "2023/24", "2022" => "2022/23" }, ) end