From 6bfe11d2df4921e1b8f4515fa14d1019c3afdfb2 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Mon, 23 May 2022 18:04:27 +0100 Subject: [PATCH] Add table caption spec --- spec/requests/users_controller_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rb index b3898edaf..b9bd46042 100644 --- a/spec/requests/users_controller_spec.rb +++ b/spec/requests/users_controller_spec.rb @@ -379,6 +379,10 @@ RSpec.describe UsersController, type: :request do expect(page).not_to have_content(user.name) expect(page).to have_content(other_user.name) end + + it "updates the table caption" do + expect(page).to have_content("Matches 1 of 5 total users") + end end context "when we need case insensitive search" do @@ -411,6 +415,10 @@ RSpec.describe UsersController, type: :request do expect(page).not_to have_content(other_org_user.name) expect(page).not_to have_content(user.name) end + + it "updates the table caption" do + expect(page).to have_content("Matches 2 of 5 total users") + end end end end @@ -832,6 +840,10 @@ RSpec.describe UsersController, type: :request do expect(page).not_to have_content(inactive_user.name) expect(page).not_to have_content(other_org_user.name) end + + it "updates the table caption" do + expect(page).to have_content("Matches 1 of 4 total users") + end end context "when we need case insensitive search" do @@ -867,6 +879,10 @@ RSpec.describe UsersController, type: :request do expect(page).to have_content(other_org_user.name) expect(page).not_to have_content(user.name) end + + it "updates the table caption" do + expect(page).to have_content("Matches 2 of 4 total users") + end end end end