From 415f07f461caa9b2f1686109c3e0768a58c8547c Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 18 May 2022 16:57:41 +0100 Subject: [PATCH] Add the remaining pagination tests --- spec/requests/organisations_controller_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb index 67d3359dd..b937bced3 100644 --- a/spec/requests/organisations_controller_spec.rb +++ b/spec/requests/organisations_controller_spec.rb @@ -353,6 +353,21 @@ RSpec.describe OrganisationsController, type: :request do it "shows the total organisations count" do expect(CGI.unescape_html(response.body)).to match("#{total_organisations_count} total organisations") end + + it "has pagination links" do + expect(page).to have_content("Previous") + expect(page).to have_link("Previous") + expect(page).to have_content("Next") + expect(page).not_to have_link("Next") + end + + it "shows which logs are being shown on the current page" do + expect(CGI.unescape_html(response.body)).to match("Showing 21 to #{total_organisations_count} of #{total_organisations_count} organisations") + end + + it "has pagination in the title" do + expect(page).to have_title("Organisations (page 2 of 2)") + end end end end