diff --git a/app/controllers/spree/admin/products_controller_decorator.rb b/app/controllers/spree/admin/products_controller_decorator.rb index 5c02970ed5..3fd18c6032 100644 --- a/app/controllers/spree/admin/products_controller_decorator.rb +++ b/app/controllers/spree/admin/products_controller_decorator.rb @@ -12,7 +12,7 @@ Spree::Admin::ProductsController.class_eval do product_set = Spree::ProductSet.new({:collection_attributes => collection_hash}) if product_set.save - redirect_to "/api/products/managed?template=bulk_index" + redirect_to "/api/products/managed?template=bulk_index&page=1&per_page=500" else render :nothing => true end diff --git a/spec/features/admin/bulk_product_update_spec.rb b/spec/features/admin/bulk_product_update_spec.rb index f1bc9f8721..c7c4aabdd1 100644 --- a/spec/features/admin/bulk_product_update_spec.rb +++ b/spec/features/admin/bulk_product_update_spec.rb @@ -286,6 +286,18 @@ feature %q{ page.find("span#update-status-message").should have_content "Update complete" end + scenario "updating a product when there are more products than the default API page size" do + 26.times { FactoryGirl.create(:simple_product) } + login_to_admin_section + + visit '/admin/products/bulk_edit' + + field = page.all("table#listing_products input[name='product_name']").first + field.set "new name" + click_button 'Update' + page.find("span#update-status-message").should have_content "Update complete" + end + describe "using action buttons" do describe "using delete buttons" do it "shows a delete button for products, which deletes the appropriate product when clicked" do