Skip to content

Commit

Permalink
Sketching some acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcasimir committed Apr 3, 2012
1 parent bde0390 commit 78c7a8b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions spec/acceptance/public_user_views_products_spec.rb
@@ -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

0 comments on commit 78c7a8b

Please sign in to comment.