diff --git a/engines/dfc_provider/spec/requests/enterprises_spec.rb b/engines/dfc_provider/spec/requests/enterprises_spec.rb index 2f8e5a6fa3..574e3c4400 100644 --- a/engines/dfc_provider/spec/requests/enterprises_spec.rb +++ b/engines/dfc_provider/spec/requests/enterprises_spec.rb @@ -59,6 +59,12 @@ describe "Enterprises", type: :request, swagger_doc: "dfc.yaml", rswag_autodoc: expect(json_response["@graph"][0]).to include( "dfc-b:affiliates" => "http://test.host/api/dfc/enterprise_groups/60000", ) + + # Insert static value to keep documentation deterministic: + response.body.gsub!( + %r{active_storage/[0-9A-Za-z/=-]*/logo-white.png}, + "active_storage/url/logo-white.png", + ) end end end diff --git a/engines/dfc_provider/spec/requests/supplied_products_spec.rb b/engines/dfc_provider/spec/requests/supplied_products_spec.rb index 47e7d7440f..3e59aa2bad 100644 --- a/engines/dfc_provider/spec/requests/supplied_products_spec.rb +++ b/engines/dfc_provider/spec/requests/supplied_products_spec.rb @@ -117,6 +117,7 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_auto expect(second_variant.unit_value).to eq 6 # Insert static value to keep documentation deterministic: + supplied_product[:'ofn:spree_product_id'] = 90_000 response.body.gsub!( "supplied_products/#{variant_id}", "supplied_products/10001" @@ -146,6 +147,12 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_auto 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") + + # Insert static value to keep documentation deterministic: + response.body.gsub!( + %r{active_storage/[0-9A-Za-z/=-]*/logo-white.png}, + "active_storage/url/logo-white.png", + ) end end diff --git a/swagger/dfc.yaml b/swagger/dfc.yaml index 06c89d015b..aa75b40b89 100644 --- a/swagger/dfc.yaml +++ b/swagger/dfc.yaml @@ -343,7 +343,7 @@ paths: dfc-b:usageOrStorageCondition: '' dfc-b:totalTheoreticalStock: 0.0 ofn:spree_product_id: 90000 - ofn:image: http://test.host/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZzBCIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--cec5b9e04720cada9134f6757e3dd8156aeccbf0/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MWm05eWJXRjBTU0lJY0c1bkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFId2FRSHciLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--a8632e6a563a139dfae774530b275266f6aef5f5/logo-white.png + ofn:image: http://test.host/rails/active_storage/url/logo-white.png - "@id": http://test.host/api/dfc/enterprises/10000/catalog_items/10001 "@type": dfc-b:CatalogItem dfc-b:references: http://test.host/api/dfc/enterprises/10000/supplied_products/10001 @@ -437,7 +437,7 @@ paths: dfc-b:lifetime: '' dfc-b:usageOrStorageCondition: '' dfc-b:totalTheoreticalStock: 0.0 - ofn:spree_product_id: 33774 + ofn:spree_product_id: 90000 "/api/dfc/enterprises/{enterprise_id}/supplied_products/{id}": parameters: - name: enterprise_id @@ -477,7 +477,7 @@ paths: dfc-b:usageOrStorageCondition: '' dfc-b:totalTheoreticalStock: 0.0 ofn:spree_product_id: 90000 - ofn:image: http://test.host/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBaElCIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--f578e58da95a3e1f6a4774dfeef31ac7cb039f0f/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MWm05eWJXRjBTU0lJY0c1bkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFId2FRSHciLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--a8632e6a563a139dfae774530b275266f6aef5f5/logo-white.png + ofn:image: http://test.host/rails/active_storage/url/logo-white.png '404': description: not found put: