Bulk product update with >25 products succeeds

This commit is contained in:
Rohan Mitchell
2013-10-16 14:36:22 +11:00
parent a898d6d831
commit 751801653e
2 changed files with 13 additions and 1 deletions

View File

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

View File

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