Skip to content

Instantly share code, notes, and snippets.

@alisterscott
Created May 30, 2012 04:58
Show Gist options
  • 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