Skip to content

Instantly share code, notes, and snippets.

@alisterscott
Created May 30, 2012 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alisterscott/2833841 to your computer and use it in GitHub Desktop.
Save alisterscott/2833841 to your computer and use it in GitHub Desktop.
Example of way to get rid of page instance variables from step defs
#https://github.com/natritmeyer/site_prism#epilogue
# was
@home = Home.new
@home.load
@home.search_field.set "Sausages"
@home.search_field.search_button.click
@results_page = SearchResults.new
@results_page.should have_search_result_items
# could be
visit_page Home do |page|
page.search_field.set "Sausages"
page.search_button.click
end
on_page(SearchResults).should have_search_result_items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment