Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 0.65 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. describe "Pages" do
  3.   # a trivial example that follows a link from "Page A" to "Page B"
  4.   shared_examples "an example page" do
  5.     it "should follow link from Page A to Page B" do
  6.       visit page_a_path
  7.       click_link "Link to B"
  8.       page.should have_content("Page B")
  9.       current_path.should == page_b_path
  10.     end
  11.   end
  12.  
  13.   # shared examples will be run in Rack::Test driver with no Javascript
  14.   context "javascript disabled" do
  15.     it_behaves_like "an example page"
  16.   end
  17.  
  18.   # shared examples will be run in Firefox (via Selenium) with full Javascript support
  19.   context "javascript enabled", :js => true do
  20.     it_behaves_like "an example page"
  21.   end
  22. end