Skip to content

Instantly share code, notes, and snippets.

@seth-macpherson
Created September 14, 2012 21:01
Show Gist options
  • Save seth-macpherson/3724783 to your computer and use it in GitHub Desktop.
Save seth-macpherson/3724783 to your computer and use it in GitHub Desktop.
Load Rails Console in TEST mode then load the capybara_irb.rb file
$ RAILS_ENV=test rails console
Loading test environment (Rails 3.2.8)
1.9.3p125 :001 > load 'test/capybara_irb.rb'
1.9.3p125 :002 > prep_test_data # this is typically run by my tests as setup :prep_test_data...
################################################################
Factory Girl pumps out all my required models to get rolling...
################################################################
1.9.3p125 :205 > visit '/admin' # this opens Firefox via the Selenium WebDriver
1.9.3p125 :206 > find('.x-some .y-selector').click # --> returns true if element is found, plus you can *see* happen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment