Check product image url is present on supplied product endpoint

This commit is contained in:
Gaetan Craig-Riou
2023-11-03 16:03:23 +11:00
committed by David Cook
parent 12c6257a0f
commit 7987967824
2 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ describe "Enterprises", type: :request, swagger_doc: "dfc.yaml", rswag_autodoc:
end
let!(:product) {
create(
:base_product,
:product_with_image,
id: 90_000, supplier: enterprise, name: "Apple", description: "Round",
variants: [variant],
)

View File

@@ -2,13 +2,12 @@
require_relative "../swagger_helper"
describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml",
rswag_autodoc: true do
describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_autodoc: true do
let!(:user) { create(:oidc_user) }
let!(:enterprise) { create(:distributor_enterprise, id: 10_000, owner: user) }
let!(:product) {
create(
:base_product,
:product_with_image,
id: 90_000,
supplier: enterprise, name: "Pesto", description: "Basil Pesto",
variants: [variant],
@@ -146,6 +145,7 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml",
run_test! do
expect(response.body).to include variant.name
expect(json_response["ofn:spree_product_id"]).to eq 90_000
expect(json_response["ofn:image"]).to include("logo-white.png")
end
end