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:
Luis Ramos
2020-02-20 11:17:21 +00:00
parent f0f537ff8f
commit 0c4f22f847
2 changed files with 11 additions and 1 deletions

View File

@@ -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'

View File

@@ -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__))