From bbcad09924b167e8e18c4d719e40b1478bb40a18 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 11 Jun 2024 14:15:22 -0600 Subject: [PATCH] Adds test case on enterprise permissions --- .../system/admin/products_v3/products_spec.rb | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/system/admin/products_v3/products_spec.rb b/spec/system/admin/products_v3/products_spec.rb index 9b4aa04b4d..18e30aa0bc 100644 --- a/spec/system/admin/products_v3/products_spec.rb +++ b/spec/system/admin/products_v3/products_spec.rb @@ -1416,6 +1416,28 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi expect(page).to have_selector row_containing_name(product_supplied_permitted.name) expect(page).not_to have_selector row_containing_name(product_not_supplied.name) end + + it "shows only suppliers that I manage or have permission to" do + visit spree.admin_products_path + + within row_containing_name(product_supplied.name) do + page.has_select?( + '_products_0_supplier_id', + options: [ + supplier_managed1.name, supplier_managed2.name, supplier_permitted.name + ], selected: supplier_managed1.name + ) + end + + within row_containing_name(product_supplied_permitted.name) do + page.has_select?( + '_products_0_supplier_id', + options: [ + supplier_managed1.name, supplier_managed2.name, supplier_permitted.name + ], selected: supplier_managed1.name + ) + end + end end def create_products(amount)