From 8a31153d6dc5678da993c63b2db2c2f8584811fc Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 2 Jul 2024 15:45:02 +1000 Subject: [PATCH] Fix API v0 products controller spec --- spec/controllers/api/v0/products_controller_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/controllers/api/v0/products_controller_spec.rb b/spec/controllers/api/v0/products_controller_spec.rb index 3633dab6ea..1a6030240c 100644 --- a/spec/controllers/api/v0/products_controller_spec.rb +++ b/spec/controllers/api/v0/products_controller_spec.rb @@ -35,8 +35,8 @@ RSpec.describe Api::V0::ProductsController, type: :controller do it "gets a single product" do product.create_image!(attachment:) - product.variants.create!(unit_value: "1", unit_description: "thing", price: 1, - primary_taxon: taxon, supplier:) + product.variants.create!(unit_value: "1", variant_unit: "weight", variant_unit_scale: 1, + unit_description: "thing", price: 1, primary_taxon: taxon, supplier:) product.variants.first.images.create!(attachment:) product.set_property("spree", "rocks") @@ -121,7 +121,7 @@ RSpec.describe Api::V0::ProductsController, type: :controller do expect(json_response["error"]).to eq("Invalid resource. Please fix errors and try again.") errors = json_response["errors"] expect(errors.keys).to match_array([ - "name", "variant_unit", "price", + "name", "price", "primary_taxon_id", "supplier_id" ]) end