Fix order permission and specs

This commit is contained in:
Gaetan Craig-Riou
2024-03-05 16:14:50 +11:00
parent 6d1a6c6d0e
commit 3d82309c5f
2 changed files with 5 additions and 5 deletions

View File

@@ -83,7 +83,7 @@ module Permissions
Spree::Order.with_line_items_variants_and_products_outer.
where(
distributor_id: granted_distributor_ids,
spree_products: { supplier_id: enterprises_with_associated_orders }
spree_variants: { supplier_id: enterprises_with_associated_orders }
).
where_clause.__send__(:predicates).
reduce(:and)

View File

@@ -88,8 +88,8 @@ module Permissions
context "which contains my products" do
before do
line_item.product.supplier = producer
line_item.product.save
line_item.variant.supplier = producer
line_item.variant.save
end
it "should let me see the order" do
@@ -165,8 +165,8 @@ module Permissions
create(:enterprise_relationship, parent: producer, child: distributor,
permissions_list: [:add_to_order_cycle])
line_item1.product.supplier = producer
line_item1.product.save
line_item1.variant.supplier = producer
line_item1.variant.save
end
it "should let me see the line_items pertaining to variants I produce" do