From 185b111ff8d933cb48e18ebc85e8b9d2f263d6a0 Mon Sep 17 00:00:00 2001 From: Samuel Date: Thu, 24 Apr 2025 11:18:33 +0100 Subject: [PATCH] update tests --- spec/models/user_spec.rb | 6 +++--- spec/requests/sales_logs_controller_spec.rb | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index cd79977cc..b78d67e9c 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -164,7 +164,7 @@ RSpec.describe User, type: :model do end it "can filter lettings logs by user, year and status" do - expect(user.logs_filters).to match_array(%w[years status needstypes assigned_to user bulk_upload_id user_text_search]) + expect(user.logs_filters).to match_array(%w[years status needstypes salestypes assigned_to user bulk_upload_id user_text_search]) end end @@ -174,7 +174,7 @@ RSpec.describe User, type: :model do end it "can filter lettings logs by user, year, status, managing_organisation and owning_organisation" do - expect(user.logs_filters).to match_array(%w[years status needstypes assigned_to user managing_organisation owning_organisation bulk_upload_id managing_organisation_text_search owning_organisation_text_search user_text_search]) + expect(user.logs_filters).to match_array(%w[years status needstypes salestypes assigned_to user managing_organisation owning_organisation bulk_upload_id managing_organisation_text_search owning_organisation_text_search user_text_search]) end it "can filter schemes by status and owning_organisation" do @@ -219,7 +219,7 @@ RSpec.describe User, type: :model do end it "can filter lettings logs by user, year, status, managing_organisation and owning_organisation" do - expect(user.logs_filters).to match_array(%w[years status needstypes assigned_to user owning_organisation managing_organisation bulk_upload_id managing_organisation_text_search owning_organisation_text_search user_text_search]) + expect(user.logs_filters).to match_array(%w[years status needstypes salestypes assigned_to user owning_organisation managing_organisation bulk_upload_id managing_organisation_text_search owning_organisation_text_search user_text_search]) end it "can filter bulk uploads by year, uploaded_by and uploading_organisation " do diff --git a/spec/requests/sales_logs_controller_spec.rb b/spec/requests/sales_logs_controller_spec.rb index 8a65e66d5..9987e1f86 100644 --- a/spec/requests/sales_logs_controller_spec.rb +++ b/spec/requests/sales_logs_controller_spec.rb @@ -981,12 +981,13 @@ RSpec.describe SalesLogsController, type: :request do it "allows updating log filters" do expect(page).to have_content("Check your filters") - expect(page).to have_link("Change", count: 5) + expect(page).to have_link("Change", count: 6) expect(page).to have_link("Change", href: "/sales-logs/filters/years?codes_only=false&referrer=check_answers&search=#{search_term}") expect(page).to have_link("Change", href: "/sales-logs/filters/assigned-to?codes_only=false&referrer=check_answers&search=#{search_term}") expect(page).to have_link("Change", href: "/sales-logs/filters/owned-by?codes_only=false&referrer=check_answers&search=#{search_term}") expect(page).to have_link("Change", href: "/sales-logs/filters/managed-by?codes_only=false&referrer=check_answers&search=#{search_term}") expect(page).to have_link("Change", href: "/sales-logs/filters/status?codes_only=false&referrer=check_answers&search=#{search_term}") + expect(page).to have_link("Change", href: "/sales-logs/filters/salestype?codes_only=false&referrer=check_answers&search=#{search_term}") end it "has a hidden field with the search term" do