Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Correct products spec to have three products so that pagination is en…

…abled
  • Loading branch information...
commit ba8eec9ca944fa1cc14358c37cc47000ec175a48 1 parent 209aefc
@radar radar authored
Showing with 8 additions and 7 deletions.
  1. +7 −6 core/spec/requests/products_spec.rb
  2. +1 −1  core/spec/spec_helper.rb
View
13 core/spec/requests/products_spec.rb
@@ -100,10 +100,10 @@
check "Price_Range_$15.00_-_$18.00"
within(:css, '#sidebar_products_search') { click_button "Search" }
- page.all('ul.product-listing li').size.should == 2
+ page.all('ul.product-listing li').size.should == 3
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 Stein", "Ruby on Rails Tote"]
+ tmp.sort!.should == ["Ruby on Rails Mug", "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
@@ -112,10 +112,10 @@
check "Price_Range_$15.00_-_$18.00"
within(:css, '#sidebar_products_search') { click_button "Search" }
- page.all('ul.product-listing li').size.should == 4
+ 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"]
+ tmp.sort!.should == ["Ruby on Rails Mug", "Ruby on Rails Tote"]
find('nav.pagination .next a').click
tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact
tmp.delete("")
@@ -128,11 +128,12 @@
check "Price_Range_$20.00_or_over"
within(:css, '#sidebar_products_search') { click_button "Search" }
- page.all('ul.product-listing li').size.should == 3
+ page.all('ul.product-listing li').size.should == 4
tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact
tmp.delete("")
tmp.sort!.should == ["Ruby on Rails Bag",
"Ruby on Rails Baseball Jersey",
- "Ruby on Rails Jr. Spaghetti"]
+ "Ruby on Rails Jr. Spaghetti",
+ "Ruby on Rails Ringer T-Shirt"]
end
end
View
2  core/spec/spec_helper.rb
@@ -76,7 +76,7 @@
ruby_taxon = FactoryGirl.create(:taxon, :name => 'Ruby', :parent_id => root.id)
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Ringer T-Shirt', :price => '19.99', :taxons => [rails_taxon, clothing_taxon])
- FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Mug', :price => '13.99', :taxons => [rails_taxon, mugs_taxon])
+ FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Mug', :price => '15.99', :taxons => [rails_taxon, mugs_taxon])
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Tote', :price => '15.99', :taxons => [rails_taxon, bags_taxon])
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Bag', :price => '22.99', :taxons => [rails_taxon, bags_taxon])
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Baseball Jersey', :price => '19.99', :taxons => [rails_taxon, clothing_taxon])
Please sign in to comment.
Something went wrong with that request. Please try again.