Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require 'spec_helper' | ||
|
||
describe "Public User Views Products" do | ||
context "the root page" do | ||
before(:each) do | ||
visit root_path | ||
end | ||
|
||
it "displays products" do | ||
within("#products") do | ||
page.should have_selector('li.product') | ||
end | ||
end | ||
|
||
it "has product links" do | ||
p = Product.first | ||
within("#products") do | ||
page.should have_link(p.to_s, :href => product_path(p)) | ||
end | ||
end | ||
end | ||
|
||
context "the product page" do | ||
let(:product){ Product.first } | ||
|
||
before(:each) do | ||
visit product_path(product) | ||
end | ||
|
||
it "displays the product name" do | ||
page.should have_selector("#name", :text => product.to_s ) | ||
end | ||
end | ||
|
||
end |