Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow pagination of product search results.

[Fixes #1539]
  • Loading branch information...
commit a84b5fdf347383a94dd26f8e9fa99fb914f128ff 1 parent 2bbe70a
@JDutil JDutil authored radar committed
View
1  core/app/views/spree/shared/_products.html.erb
@@ -26,6 +26,5 @@
<% end %>
<% if paginated_products.respond_to?(:num_pages)
- params.delete(:search)
params.delete(:taxon)
%><%= paginate paginated_products %><% end %>
View
16 core/spec/requests/products_spec.rb
@@ -106,6 +106,22 @@
tmp.sort!.should == ["Ruby on Rails Ringer T-Shirt", "Ruby on Rails Stein", "Ruby on Rails Tote"]
end
+ it "should be able to display products priced between 15 and 18 dollars across multiple pages" do
+ Spree::Config.products_per_page = 2
+ within(:css, '#taxonomies') { click_link "Ruby on Rails" }
+ check "Price_Range_$15.00_-_$18.00"
+ within(:css, '#sidebar_products_search') { click_button "Search" }
+
+ page.all('ul.product-listing li').size.should == 2
+ tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact
+ tmp.delete("")
+ tmp.sort!.should == ["Ruby on Rails Ringer T-Shirt", "Ruby on Rails Tote"]
+ find('nav.pagination .next a').click
+ tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact
+ tmp.delete("")
+ tmp.sort!.should == ["Ruby on Rails Stein"]
+ end
+
it "should be able to display products priced 18 dollars and above" do
within(:css, '#taxonomies') { click_link "Ruby on Rails" }
check "Price_Range_$18.00_-_$20.00"
Please sign in to comment.
Something went wrong with that request. Please try again.