
Untitled
By: a guest on
May 6th, 2012 | syntax:
None | size: 0.65 KB | hits: 10 | expires: Never
describe "Pages" do
# a trivial example that follows a link from "Page A" to "Page B"
shared_examples "an example page" do
it "should follow link from Page A to Page B" do
visit page_a_path
click_link "Link to B"
page.should have_content("Page B")
current_path.should == page_b_path
end
end
# shared examples will be run in Rack::Test driver with no Javascript
context "javascript disabled" do
it_behaves_like "an example page"
end
# shared examples will be run in Firefox (via Selenium) with full Javascript support
context "javascript enabled", :js => true do
it_behaves_like "an example page"
end
end