diff --git a/app/controllers/spree/admin/images_controller_decorator.rb b/app/controllers/spree/admin/images_controller_decorator.rb new file mode 100644 index 0000000000..c8ec1cf208 --- /dev/null +++ b/app/controllers/spree/admin/images_controller_decorator.rb @@ -0,0 +1,6 @@ +Spree::Admin::ImagesController.class_eval do + # This will make resource controller redirect correctly after deleting product images. + # This can be removed after upgrading to Spree 2.1. + # See here https://github.com/spree/spree/commit/334a011d2b8e16355e4ae77ae07cd93f7cbc8fd1 + belongs_to 'spree/product', :find_by => :permalink +end diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index 65cbe4f9df..a687414125 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -210,7 +210,7 @@ feature %q{ page.should have_field 'product_product_properties_attributes_0_value', with: 'fooval' # And I delete the property - page.all('a.remove_fields').first.click + page.all('a.delete-resource').first.click click_button 'Update' # Then the property should have been deleted