From 48a39f20e824829daf3152de25c82f40107b1e29 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 19 Jun 2024 19:30:42 -0600 Subject: [PATCH] Adds regression spec for #12591 --- spec/system/admin/products_spec.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/spec/system/admin/products_spec.rb b/spec/system/admin/products_spec.rb index 6749306522..2ca528c261 100644 --- a/spec/system/admin/products_spec.rb +++ b/spec/system/admin/products_spec.rb @@ -197,6 +197,30 @@ RSpec.describe ' expect(page).to have_content "Unit value is not a number" end + it "creating product with empty product category" do + pending("#12591") + + login_as_admin + visit spree.admin_products_path + + click_link 'New Product' + + fill_in 'product_name', with: 'Hot Cakes' + select 'New supplier', from: 'product_supplier_id' + select "Weight (kg)", from: 'product_variant_unit_with_scale' + fill_in "product_unit_value", with: '1' + fill_in 'product_price', with: '1.99' + fill_in 'product_on_hand', with: 0 + check 'product_on_demand' + select 'Test Tax Category', from: 'product_tax_category_id' + fill_in_trix_editor 'product_description', + with: 'In demand, and on_demand! The hottest cakes in town.' + click_button 'Create' + + expect(current_path).to eq spree.admin_products_path + expect(page).to have_content "Product Category must exist" + end + describe "localization settings" do shared_examples "with different price values" do |localized_number, price| context "when enable_localized_number is set to #{localized_number}" do