mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add all the enterpise attributes supported by DFC connector
This commit is contained in:
committed by
Maikel Linke
parent
3c617a51e0
commit
18565f4a85
@@ -7,11 +7,12 @@ class EnterpriseBuilder < DfcBuilder
|
||||
supplied_products = catalog_items.map(&:product)
|
||||
|
||||
DataFoodConsortium::Connector::Enterprise.new(
|
||||
enterprise.name
|
||||
).tap do |e|
|
||||
e.semanticId = urls.enterprise_url(enterprise.id)
|
||||
e.suppliedProducts = supplied_products
|
||||
e.catalogItems = catalog_items
|
||||
end
|
||||
urls.enterprise_url(enterprise.id),
|
||||
name: enterprise.name,
|
||||
description: enterprise.description,
|
||||
vatNumber: enterprise.abn,
|
||||
suppliedProducts: supplied_products,
|
||||
catalogItems: catalog_items
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,6 +16,24 @@ describe EnterpriseBuilder do
|
||||
)
|
||||
end
|
||||
|
||||
it "assigns a name" do
|
||||
result = builder.enterprise(enterprise)
|
||||
|
||||
expect(result.name).to eq(enterprise.name)
|
||||
end
|
||||
|
||||
it "assigns a description" do
|
||||
result = builder.enterprise(enterprise)
|
||||
|
||||
expect(result.description).to eq(enterprise.description)
|
||||
end
|
||||
|
||||
it "assigns a VAT Number (ABN in australia)" do
|
||||
result = builder.enterprise(enterprise)
|
||||
|
||||
expect(result.vatNumber).to eq(enterprise.abn)
|
||||
end
|
||||
|
||||
it "assignes products" do
|
||||
result = builder.enterprise(enterprise)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user