|
|
@ -757,9 +757,11 @@ RSpec.describe UsersController, type: :request do |
|
|
|
|
|
|
|
|
|
|
|
context "when a search parameter is passed" do |
|
|
|
context "when a search parameter is passed" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
get "/users?user-search-field=Danny" |
|
|
|
get "/users?user-search-field=#{search_param}" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when our search string matches case" do |
|
|
|
|
|
|
|
let (:search_param){"Danny"} |
|
|
|
it "returns only matching results" do |
|
|
|
it "returns only matching results" do |
|
|
|
expect(page).to have_content(user.name) |
|
|
|
expect(page).to have_content(user.name) |
|
|
|
expect(page).not_to have_content(other_user.name) |
|
|
|
expect(page).not_to have_content(other_user.name) |
|
|
@ -767,6 +769,17 @@ RSpec.describe UsersController, type: :request do |
|
|
|
expect(page).not_to have_content(other_org_user.name) |
|
|
|
expect(page).not_to have_content(other_org_user.name) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when we need case insensitive search" do |
|
|
|
|
|
|
|
let (:search_param){"danny"} |
|
|
|
|
|
|
|
it "returns only matching results" do |
|
|
|
|
|
|
|
expect(page).to have_content(user.name) |
|
|
|
|
|
|
|
expect(page).not_to have_content(other_user.name) |
|
|
|
|
|
|
|
expect(page).not_to have_content(inactive_user.name) |
|
|
|
|
|
|
|
expect(page).not_to have_content(other_org_user.name) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe "CSV download" do |
|
|
|
describe "CSV download" do |
|
|
|