mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Update variant's quantity from DFC
This commit is contained in:
@@ -18,6 +18,11 @@ module DfcProvider
|
||||
variant.product.update!(
|
||||
description: dfc_request["dfc-b:description"],
|
||||
)
|
||||
|
||||
# This input is DFC v1.6 currently sent by the DFC Prototype.
|
||||
variant.update!(
|
||||
unit_value: dfc_request["dfc-b:quantity"],
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -51,6 +51,7 @@ describe "SuppliedProducts", type: :request do
|
||||
expect(response).to have_http_status :success
|
||||
variant.reload
|
||||
}.to change { variant.description }.to("DFC-Pesto updated")
|
||||
.and change { variant.unit_value }.to(17)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -81,5 +81,5 @@
|
||||
}
|
||||
},
|
||||
"dfc-b:description": "DFC-Pesto updated",
|
||||
"dfc-b:quantity": 0
|
||||
"dfc-b:quantity": 17
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user