mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-23 05:28:53 +00:00
Fix API v0 variants controller spec
This commit is contained in:
@@ -144,9 +144,9 @@ RSpec.describe Api::V0::VariantsController, type: :controller do
|
||||
|
||||
it "can create a new variant" do
|
||||
original_number_of_variants = variant.product.variants.count
|
||||
api_post :create, variant: { sku: "12345", unit_value: "1", unit_description: "L",
|
||||
price: "1", primary_taxon_id: taxon.id,
|
||||
supplier_id: variant.supplier.id },
|
||||
api_post :create, variant: { sku: "12345", unit_value: "1", variant_unit: "weight",
|
||||
variant_unit_scale: 1, unit_description: "L", price: "1",
|
||||
primary_taxon_id: taxon.id, supplier_id: variant.supplier.id },
|
||||
product_id: variant.product.id
|
||||
|
||||
expect(attributes.all?{ |attr| json_response.include? attr.to_s }).to eq(true)
|
||||
|
||||
Reference in New Issue
Block a user