mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Fix product filtering
This commit is contained in:
committed by
Gaetan Craig-Riou
parent
78495d0ace
commit
fb09a7f1e6
@@ -126,7 +126,7 @@ module Api
|
||||
context "with taxon filters" do
|
||||
it "filters by taxon" do
|
||||
api_get :products, id: order_cycle.id, distributor: distributor.id,
|
||||
q: { primary_taxon_id_in_any: [taxon2.id] }
|
||||
q: { variants_primary_taxon_id_in_any: [taxon2.id] }
|
||||
|
||||
expect(product_ids).to include product2.id, product3.id
|
||||
expect(product_ids).not_to include product1.id, product4.id
|
||||
|
||||
@@ -267,7 +267,7 @@ describe Api::V0::ProductsController, type: :controller do
|
||||
end
|
||||
|
||||
it "filters results by product category" do
|
||||
api_get :bulk_products, { page: 1, per_page: 15, q: { primary_taxon_id_eq: taxon.id } },
|
||||
api_get :bulk_products, { page: 1, per_page: 15, q: { variants_primary_taxon_id_eq: taxon.id } },
|
||||
format: :json
|
||||
expect(returned_product_ids).to eq [product3.id, product2.id]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user