From 9433e4a7134393698ba99b896adc4bc3ccb703fd Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Wed, 13 Dec 2023 14:31:14 +0000 Subject: [PATCH] feat: update tests now search/filterless copy has changed --- .../search_result_caption_component_spec.rb | 2 +- spec/features/organisation_spec.rb | 4 ++-- spec/features/schemes_spec.rb | 4 ++-- spec/requests/lettings_logs_controller_spec.rb | 4 ++-- .../organisation_relationships_controller_spec.rb | 12 ++++++------ spec/requests/organisations_controller_spec.rb | 10 +++++----- spec/requests/sales_logs_controller_spec.rb | 4 ++-- spec/requests/schemes_controller_spec.rb | 6 +++--- spec/requests/users_controller_spec.rb | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/spec/components/search_result_caption_component_spec.rb b/spec/components/search_result_caption_component_spec.rb index a6f7c3c3b..25cbc1bdd 100644 --- a/spec/components/search_result_caption_component_spec.rb +++ b/spec/components/search_result_caption_component_spec.rb @@ -36,7 +36,7 @@ RSpec.describe SearchResultCaptionComponent, type: :component do let(:filters_count) { nil } it "renders table caption with total count only" do - expect(result.to_html).to eq("\n \n 2 matching schemes\n \n\n") + expect(result.to_html).to eq("\n \n 2 total schemes\n \n\n") end end diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index 69a5d8b5c..9cef5edb5 100644 --- a/spec/features/organisation_spec.rb +++ b/spec/features/organisation_spec.rb @@ -189,7 +189,7 @@ RSpec.describe "User Features" do end it "has correct page details" do - expect(page).to have_content("#{number_of_lettings_logs} matching logs") + expect(page).to have_content("#{number_of_lettings_logs} total logs") organisation.lettings_logs.map(&:id).each do |lettings_log_id| expect(page).to have_link lettings_log_id.to_s, href: "/lettings-logs/#{lettings_log_id}" end @@ -237,7 +237,7 @@ RSpec.describe "User Features" do end it "can filter sales logs" do - expect(page).to have_content("#{number_of_sales_logs} matching logs") + expect(page).to have_content("#{number_of_sales_logs} total logs") 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 diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 88c3099a0..491a19bbc 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -573,7 +573,7 @@ RSpec.describe "Schemes scheme Features" do it "displays information about a single location" do expect(page).to have_content "Locations" - expect(page).to have_content "#{scheme.locations.count} matching location" + expect(page).to have_content "#{scheme.locations.count} total location" end it "displays information about the first created location" do @@ -586,7 +586,7 @@ RSpec.describe "Schemes scheme Features" do fill_in_and_save_second_location click_button "Save and return to locations" expect(page).to have_content "Locations" - expect(page).to have_content "#{scheme.locations.count} matching location" + expect(page).to have_content "#{scheme.locations.count} total location" end it "displays information about newly created location" do diff --git a/spec/requests/lettings_logs_controller_spec.rb b/spec/requests/lettings_logs_controller_spec.rb index 646855f2e..97db942b1 100644 --- a/spec/requests/lettings_logs_controller_spec.rb +++ b/spec/requests/lettings_logs_controller_spec.rb @@ -788,7 +788,7 @@ RSpec.describe LettingsLogsController, type: :request do end it "shows the total log count" do - expect(CGI.unescape_html(response.body)).to match("1 matching logs") + expect(CGI.unescape_html(response.body)).to match("1 total logs") end it "does not show the pagination links" do @@ -882,7 +882,7 @@ RSpec.describe LettingsLogsController, type: :request do end it "shows the total log count" do - expect(CGI.unescape_html(response.body)).to match("26 matching logs") + expect(CGI.unescape_html(response.body)).to match("26 total logs") end it "has pagination links" do diff --git a/spec/requests/organisation_relationships_controller_spec.rb b/spec/requests/organisation_relationships_controller_spec.rb index dcf99efce..a93e77d76 100644 --- a/spec/requests/organisation_relationships_controller_spec.rb +++ b/spec/requests/organisation_relationships_controller_spec.rb @@ -47,7 +47,7 @@ RSpec.describe OrganisationRelationshipsController, type: :request do end it "shows the pagination count" do - expect(page).to have_content("1 matching stock owners") + expect(page).to have_content("1 total stock owners") end context "when adding a stock owner" do @@ -113,7 +113,7 @@ RSpec.describe OrganisationRelationshipsController, type: :request do end it "shows the pagination count" do - expect(page).to have_content("1 matching agents") + expect(page).to have_content("1 total agents") end end @@ -285,7 +285,7 @@ RSpec.describe OrganisationRelationshipsController, type: :request do end it "shows the pagination count" do - expect(page).to have_content("1 matching stock owners") + expect(page).to have_content("1 total stock owners") end end @@ -421,7 +421,7 @@ RSpec.describe OrganisationRelationshipsController, type: :request do end it "shows the pagination count" do - expect(page).to have_content("1 matching agents") + expect(page).to have_content("1 total agents") end end @@ -587,7 +587,7 @@ RSpec.describe OrganisationRelationshipsController, type: :request do end it "shows the pagination count" do - expect(page).to have_content("1 matching stock owners") + expect(page).to have_content("1 total stock owners") end context "when adding a stock owner" do @@ -637,7 +637,7 @@ RSpec.describe OrganisationRelationshipsController, type: :request do end it "shows the pagination count" do - expect(page).to have_content("1 matching agents") + expect(page).to have_content("1 total agents") end it "shows remove link(s)" do diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb index fbc8aa336..97665f8ca 100644 --- a/spec/requests/organisations_controller_spec.rb +++ b/spec/requests/organisations_controller_spec.rb @@ -531,7 +531,7 @@ RSpec.describe OrganisationsController, type: :request do end it "shows the pagination count" do - expect(page).to have_content("#{user.organisation.users.count} matching users") + expect(page).to have_content("#{user.organisation.users.count} total users") end end @@ -915,7 +915,7 @@ RSpec.describe OrganisationsController, type: :request do total_number_of_orgs = Organisation.all.count expect(page).to have_link organisation.name, href: "organisations/#{organisation.id}/lettings-logs" expect(page).to have_link unauthorised_organisation.name, href: "organisations/#{unauthorised_organisation.id}/lettings-logs" - expect(page).to have_content("#{total_number_of_orgs} matching organisations") + expect(page).to have_content("#{total_number_of_orgs} total organisations") end it "shows a search bar" do @@ -944,7 +944,7 @@ RSpec.describe OrganisationsController, type: :request do end it "only shows logs for that organisation" do - expect(page).to have_content("#{total_number_of_org1_logs} matching logs") + expect(page).to have_content("#{total_number_of_org1_logs} total logs") organisation.lettings_logs.visible.map(&:id).each do |lettings_log_id| expect(page).to have_link lettings_log_id.to_s, href: "/lettings-logs/#{lettings_log_id}" @@ -1098,7 +1098,7 @@ RSpec.describe OrganisationsController, type: :request do end it "only shows logs for that organisation" do - expect(page).to have_content("#{number_of_org1_sales_logs} matching logs") + expect(page).to have_content("#{number_of_org1_sales_logs} total logs") 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 @@ -1359,7 +1359,7 @@ RSpec.describe OrganisationsController, type: :request do end it "shows the total organisations count" do - expect(CGI.unescape_html(response.body)).to match("#{total_organisations_count} matching organisations") + expect(CGI.unescape_html(response.body)).to match("#{total_organisations_count} total organisations") end it "has pagination links" do diff --git a/spec/requests/sales_logs_controller_spec.rb b/spec/requests/sales_logs_controller_spec.rb index e3d5c9e0f..4b16d81ef 100644 --- a/spec/requests/sales_logs_controller_spec.rb +++ b/spec/requests/sales_logs_controller_spec.rb @@ -703,7 +703,7 @@ RSpec.describe SalesLogsController, type: :request do end it "shows the total log count" do - expect(CGI.unescape_html(response.body)).to match("1 matching logs") + expect(CGI.unescape_html(response.body)).to match("1 total logs") end it "does not show the pagination links" do @@ -756,7 +756,7 @@ RSpec.describe SalesLogsController, type: :request do end it "shows the total log count" do - expect(CGI.unescape_html(response.body)).to match("26 matching logs") + expect(CGI.unescape_html(response.body)).to match("26 total logs") end it "has pagination links" do diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 929fe7db8..0abeb92ae 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -297,7 +297,7 @@ RSpec.describe SchemesController, type: :request do end it "shows the total organisations count" do - expect(CGI.unescape_html(response.body)).to match("#{schemes.count} matching schemes") + expect(CGI.unescape_html(response.body)).to match("#{schemes.count} total schemes") end context "when paginating over 20 results" do @@ -313,7 +313,7 @@ RSpec.describe SchemesController, type: :request do end it "shows the total schemes count" do - expect(CGI.unescape_html(response.body)).to match("#{total_schemes_count} matching schemes") + expect(CGI.unescape_html(response.body)).to match("#{total_schemes_count} total schemes") end it "shows which schemes are being shown on the current page" do @@ -338,7 +338,7 @@ RSpec.describe SchemesController, type: :request do end it "shows the total schemes count" do - expect(CGI.unescape_html(response.body)).to match("#{total_schemes_count} matching schemes") + expect(CGI.unescape_html(response.body)).to match("#{total_schemes_count} total schemes") end it "has pagination links" do diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rb index aad0b9f28..7f1b3ffef 100644 --- a/spec/requests/users_controller_spec.rb +++ b/spec/requests/users_controller_spec.rb @@ -1194,7 +1194,7 @@ RSpec.describe UsersController, type: :request do end it "shows the pagination count" do - expect(page).to have_content("4 matching users") + expect(page).to have_content("4 total users") end it "shows the download csv link" do