mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Bulk product update with >25 products succeeds
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user