Update test to check for Product Type

This commit is contained in:
Gaetan Craig-Riou
2023-10-31 14:37:26 +11:00
parent 403386ea09
commit 8014aa4c2f

View File

@@ -11,9 +11,11 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_auto
id: 90_000,
supplier: enterprise, name: "Pesto", description: "Basil Pesto",
variants: [variant],
primary_taxon: taxon
)
}
let(:variant) { build(:base_variant, id: 10_001, unit_value: 1) }
let(:taxon) { build(:taxon, name: "Local grocery store", dfc_name: "local_grocery_store") }
before { login_as user }
@@ -146,6 +148,7 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_auto
run_test! do
expect(response.body).to include variant.name
expect(json_response["ofn:spree_product_id"]).to eq 90_000
expect(json_response["dfc-b:hasType"]).to include("Local grocery store")
expect(json_response["ofn:image"]).to include("logo-white.png")
# Insert static value to keep documentation deterministic: