Browse Source

feat: update tests now search/filterless copy has changed

pull/2083/head
natdeanlewissoftwire 2 years ago
parent
commit
9433e4a713
  1. 2
      spec/components/search_result_caption_component_spec.rb
  2. 4
      spec/features/organisation_spec.rb
  3. 4
      spec/features/schemes_spec.rb
  4. 4
      spec/requests/lettings_logs_controller_spec.rb
  5. 12
      spec/requests/organisation_relationships_controller_spec.rb
  6. 10
      spec/requests/organisations_controller_spec.rb
  7. 4
      spec/requests/sales_logs_controller_spec.rb
  8. 6
      spec/requests/schemes_controller_spec.rb
  9. 2
      spec/requests/users_controller_spec.rb

2
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("<span>\n <span class=\"govuk-!-margin-right-4\">\n <strong>2</strong> matching schemes\n </span>\n</span>\n")
expect(result.to_html).to eq("<span>\n <span class=\"govuk-!-margin-right-4\">\n <strong>2</strong> total schemes\n </span>\n</span>\n")
end
end

4
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

4
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

4
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("<strong>1</strong> matching logs")
expect(CGI.unescape_html(response.body)).to match("<strong>1</strong> 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("<strong>26</strong> matching logs")
expect(CGI.unescape_html(response.body)).to match("<strong>26</strong> total logs")
end
it "has pagination links" do

12
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

10
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("<strong>#{total_organisations_count}</strong> matching organisations")
expect(CGI.unescape_html(response.body)).to match("<strong>#{total_organisations_count}</strong> total organisations")
end
it "has pagination links" do

4
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("<strong>1</strong> matching logs")
expect(CGI.unescape_html(response.body)).to match("<strong>1</strong> 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("<strong>26</strong> matching logs")
expect(CGI.unescape_html(response.body)).to match("<strong>26</strong> total logs")
end
it "has pagination links" do

6
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("<strong>#{schemes.count}</strong> matching schemes")
expect(CGI.unescape_html(response.body)).to match("<strong>#{schemes.count}</strong> 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("<strong>#{total_schemes_count}</strong> matching schemes")
expect(CGI.unescape_html(response.body)).to match("<strong>#{total_schemes_count}</strong> 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("<strong>#{total_schemes_count}</strong> matching schemes")
expect(CGI.unescape_html(response.body)).to match("<strong>#{total_schemes_count}</strong> total schemes")
end
it "has pagination links" do

2
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

Loading…
Cancel
Save