Skip to content

Commit

Permalink
make ransack search matchers case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
phonghpham committed Dec 17, 2023
1 parent 8d62fbc commit 7b8ab9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<div class="row">
<div class="form-group mb-3 col-md-4">
<%= f.label :name_cont, "Pet Name" %>
<%= f.text_field :name_cont, class: "form-control", placeholder: "Enter Pet Name" %>
<%= f.text_field :name_i_cont, class: "form-control", placeholder: "Enter Pet Name" %>
</div>
<div class="form-group mb-3 col-md-4">
<%= f.label :adopter_applications_applicant_name_cont, "Applicant Name" %>
<%= f.text_field :adopter_applications_applicant_name_cont, class: "form-control", placeholder: "Enter Applicant Name" %>
<%= f.text_field :adopter_applications_applicant_name_i_cont, class: "form-control", placeholder: "Enter Applicant Name" %>
</div>
<div class="form-group mb-3 col-md-4">
<%= f.label :adopter_applications_status_eq, "Application Status" %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Organizations::AdoptionApplicationReviewsControllerTest < ActionDispatch::
end

should "return applications for a specific pet name" do
get adoption_application_reviews_url, params: {q: {name_cont: "Pango"}}
get adoption_application_reviews_url, params: {q: {name_i_cont: "Pango"}}
assert_response :success
assert_match "Pango", @response.body
refute_match "Tycho", @response.body
Expand All @@ -44,7 +44,7 @@ class Organizations::AdoptionApplicationReviewsControllerTest < ActionDispatch::
end

should "return applications for a specific applicant name" do
get adoption_application_reviews_url, params: {q: {adopter_applications_applicant_name_cont: "Attenborough"}}
get adoption_application_reviews_url, params: {q: {adopter_applications_applicant_name_i_cont: "Attenborough"}}
assert_response :success
assert_match "Attenborough, David", @response.body
refute_match "Goodall, Jane", @response.body
Expand Down

0 comments on commit 7b8ab9c

Please sign in to comment.