Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve variant and product autocomplete functions flexibility with Ransack #4767

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Ensure Spree::Admin::SearchController accepts custom ransack
See next commit.
  • Loading branch information
RyanofWoods committed Dec 13, 2022
commit dda72f682e4ce9a2b614341693a07cae2450a8e2
16 changes: 13 additions & 3 deletions backend/spec/controllers/spree/admin/search_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,20 @@ def starting_letters(string)
end

context 'when ids param is not present' do
let(:params) { { q: { name_cont: 'jersey' } } }
context "when the default ransack is used" do
let(:params) { { q: { name_cont: 'jersey' } } }

it_should_behave_like 'product search' do
let(:expected_products) { [product_one, product_two] }
it_should_behave_like 'product search' do
let(:expected_products) { [product_one, product_two] }
end
end

context "when a custom ransack query is used" do
let(:params) { { q: { slug_eq: 'better-jersey' } } }

it_should_behave_like 'product search' do
let(:expected_products) { [product_two] }
end
end
end

Expand Down