mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Merge pull request #12525 from mkllnk/fdc-import
Add compatibility to the DFC product import for FDC (Shopify) API
This commit is contained in:
@@ -41,4 +41,27 @@ RSpec.describe "DFC Product Import" do
|
||||
expect(page).to have_content "Importing a DFC product catalog"
|
||||
expect(page).to have_content "Imported products: 1"
|
||||
end
|
||||
|
||||
it "imports from a FDC catalog", vcr: true do
|
||||
user.oidc_account.update!(
|
||||
uid: "testdfc@protonmail.com",
|
||||
refresh_token: ENV.fetch("OPENID_REFRESH_TOKEN"),
|
||||
updated_at: 1.day.ago,
|
||||
)
|
||||
|
||||
visit admin_product_import_path
|
||||
|
||||
select enterprise.name, from: "Enterprise"
|
||||
|
||||
url = "https://food-data-collaboration-produc-fe870152f634.herokuapp.com/fdc/products?shop=test-hodmedod.myshopify.com"
|
||||
fill_in "catalog_url", with: url
|
||||
|
||||
expect {
|
||||
click_button "Import"
|
||||
}.to change {
|
||||
enterprise.supplied_products.count
|
||||
}
|
||||
|
||||
expect(page).to have_content "Importing a DFC product catalog"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user