mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
Use full product and variant name on DFC API
This commit is contained in:
@@ -9,7 +9,7 @@ class SuppliedProductBuilder < DfcBuilder
|
||||
|
||||
DfcProvider::SuppliedProduct.new(
|
||||
id,
|
||||
name: variant.name_to_display,
|
||||
name: variant.product_and_full_name,
|
||||
description: variant.description,
|
||||
productType: product_type,
|
||||
quantity: QuantitativeValueBuilder.quantity(variant),
|
||||
|
||||
@@ -41,7 +41,7 @@ describe EnterpriseBuilder do
|
||||
expect(variant).to be_persisted
|
||||
|
||||
expect(result.suppliedProducts.count).to eq 1
|
||||
expect(result.suppliedProducts[0].name).to eq "Apple"
|
||||
expect(result.suppliedProducts[0].name).to eq "Apple - 1g"
|
||||
end
|
||||
|
||||
it "assigns an address" do
|
||||
|
||||
@@ -38,7 +38,7 @@ describe SuppliedProductBuilder do
|
||||
variant.display_name = "Granny Smith"
|
||||
product = builder.supplied_product(variant)
|
||||
|
||||
expect(product.name).to eq "Granny Smith"
|
||||
expect(product.name).to eq "Apple - Granny Smith"
|
||||
end
|
||||
|
||||
it "assigns a product type" do
|
||||
|
||||
@@ -108,7 +108,7 @@ paths:
|
||||
dfc-b:offeredThrough: http://test.host/api/dfc/enterprises/10000/offers/10001
|
||||
- "@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001
|
||||
"@type": dfc-b:SuppliedProduct
|
||||
dfc-b:name: Apple
|
||||
dfc-b:name: Apple - 1g
|
||||
dfc-b:description: Red
|
||||
dfc-b:hasType: dfc-pt:non-local-vegetable
|
||||
dfc-b:hasQuantity:
|
||||
@@ -339,7 +339,7 @@ paths:
|
||||
dfc-b:hasCountry: Australia
|
||||
- "@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001
|
||||
"@type": dfc-b:SuppliedProduct
|
||||
dfc-b:name: Apple
|
||||
dfc-b:name: Apple - 1g
|
||||
dfc-b:description: Round
|
||||
dfc-b:hasType: dfc-pt:non-local-vegetable
|
||||
dfc-b:hasQuantity:
|
||||
@@ -444,7 +444,7 @@ paths:
|
||||
"@context": https://www.datafoodconsortium.org
|
||||
"@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001
|
||||
"@type": dfc-b:SuppliedProduct
|
||||
dfc-b:name: Apple
|
||||
dfc-b:name: Apple - 6g
|
||||
dfc-b:description: A delicious heritage apple
|
||||
dfc-b:hasType: dfc-pt:non-local-vegetable
|
||||
dfc-b:hasQuantity:
|
||||
@@ -508,7 +508,7 @@ paths:
|
||||
"@context": https://www.datafoodconsortium.org
|
||||
"@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001
|
||||
"@type": dfc-b:SuppliedProduct
|
||||
dfc-b:name: Pesto
|
||||
dfc-b:name: Pesto - 1g
|
||||
dfc-b:description: Basil Pesto
|
||||
dfc-b:hasType: dfc-pt:non-local-vegetable
|
||||
dfc-b:hasQuantity:
|
||||
|
||||
Reference in New Issue
Block a user