From 2ef5cab3c2a40cbf34c07ac3ff93b4d7df714713 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 11 Jun 2024 14:37:40 -0600 Subject: [PATCH] Adds test to check permissions when updating a product --- spec/system/admin/products_v3/products_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/system/admin/products_v3/products_spec.rb b/spec/system/admin/products_v3/products_spec.rb index 4221418a46..330895625d 100644 --- a/spec/system/admin/products_v3/products_spec.rb +++ b/spec/system/admin/products_v3/products_spec.rb @@ -1457,6 +1457,18 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi expect(page).to have_content "Changes saved" expect(page).to have_selector row_containing_name("Pommes") end + + it "allows me to update a product" do + visit spree.admin_products_path + + within row_containing_name(product_supplied.name) do + fill_in "Name", with: "Pommes" + end + click_button "Save changes" + + expect(page).to have_content "Changes saved" + expect(page).to have_selector row_containing_name("Pommes") + end end def create_products(amount)