|
|
|
@ -1431,7 +1431,7 @@ RSpec.describe OrganisationsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when a search parameter is passed" do |
|
|
|
context "when a search parameter is passed" do |
|
|
|
let!(:matching_user) { create(:user, organisation:, name: "joe", email: "matching@example.com") } |
|
|
|
let!(:matching_user) { create(:user, organisation:, name: "abcdefghijklmnopqrstuvwxyz", email: "matching@example.com") } |
|
|
|
let(:org_user_count) { User.where(organisation:).count } |
|
|
|
let(:org_user_count) { User.where(organisation:).count } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
@ -1439,7 +1439,7 @@ RSpec.describe OrganisationsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when our search string matches case" do |
|
|
|
context "when our search string matches case" do |
|
|
|
let(:search_param) { "joe" } |
|
|
|
let(:search_param) { "abcdefghijklmnopqrstuvwxyz" } |
|
|
|
|
|
|
|
|
|
|
|
it "returns only matching results" do |
|
|
|
it "returns only matching results" do |
|
|
|
expect(page).to have_content(matching_user.name) |
|
|
|
expect(page).to have_content(matching_user.name) |
|
|
|
@ -1459,7 +1459,7 @@ RSpec.describe OrganisationsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when we need case insensitive search" do |
|
|
|
context "when we need case insensitive search" do |
|
|
|
let(:search_param) { "Joe" } |
|
|
|
let(:search_param) { "Abcdefghijklmnopqrstuvwxyz" } |
|
|
|
|
|
|
|
|
|
|
|
it "returns only matching results" do |
|
|
|
it "returns only matching results" do |
|
|
|
expect(page).to have_content(matching_user.name) |
|
|
|
expect(page).to have_content(matching_user.name) |
|
|
|
|