mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Fix images/new.js path and add simple spec to verify the page loads correctly
Testing the file upload would be a bit more complicated
This commit is contained in:
@@ -7,4 +7,4 @@
|
||||
%span.or= t('spree.or')
|
||||
= link_to_with_icon 'icon-remove', t('spree.actions.cancel'), admin_product_images_url(@product), id: 'cancel_link', class: 'button'
|
||||
|
||||
= javascript_include_tag 'admin/images/new.js'
|
||||
= javascript_include_tag 'admin/spree/images/new.js'
|
||||
|
||||
@@ -203,6 +203,16 @@ feature '
|
||||
expect(p.reload.property('fooprop')).to be_nil
|
||||
end
|
||||
|
||||
scenario "loading new image page", js: true do
|
||||
product = create(:simple_product, supplier: @supplier2)
|
||||
|
||||
visit spree.admin_product_images_path(product)
|
||||
expect(page).to have_selector ".no-objects-found"
|
||||
|
||||
page.find('a#new_image_link').click
|
||||
expect(page).to have_selector "#image_attachment"
|
||||
end
|
||||
|
||||
scenario "deleting product images", js: true do
|
||||
product = create(:simple_product, supplier: @supplier2)
|
||||
image = File.open(File.expand_path('../../../app/assets/images/logo-white.png', __dir__))
|
||||
|
||||
Reference in New Issue
Block a user