Publish enterprise website with https://

This commit is contained in:
Maikel Linke
2024-04-23 13:50:46 +10:00
parent 8d166ed3e1
commit 64d633c64e
3 changed files with 5 additions and 1 deletions

View File

@@ -23,6 +23,9 @@ class EnterpriseBuilder < DfcBuilder
socialMedias: SocialMediaBuilder.social_medias(enterprise),
websites: [enterprise.website].compact,
).tap do |e|
# The model strips the protocol and we need to add it:
e.websites = e.websites.map { |url| "https://#{url}" }
add_ofn_property(e, "ofn:long_description", enterprise.long_description)
# This could be expressed as dfc-b:hasMainContact Person with name.

View File

@@ -71,6 +71,7 @@ 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",
"dfc-b:websitePage" => "https://openfoodnetwork.org",
)
# Insert static value to keep documentation deterministic:

View File

@@ -376,7 +376,7 @@ paths:
dfc-b:hasAddress: http://test.host/api/dfc/addresses/40000
dfc-b:hasPhoneNumber: 0404 444 000 200
dfc-b:email: hello@example.org
dfc-b:websitePage: openfoodnetwork.org
dfc-b:websitePage: https://openfoodnetwork.org
dfc-b:hasSocialMedia: http://test.host/api/dfc/enterprises/10000/social_medias/facebook
dfc-b:logo: ''
dfc-b:name: Fred's Farm