Skip to content

Instantly share code, notes, and snippets.

@13k
Created July 10, 2012 22:49
Show Gist options
  • Save 13k/3086739 to your computer and use it in GitHub Desktop.
Save 13k/3086739 to your computer and use it in GitHub Desktop.
Capybara in Rails Console
# rails console test
# # or
# RAILS_ENV=test rails console
require 'capybara/dsl'
Capybara.app = app.instance_variable_get("@app")
cap = Object.new.instance_eval { extend Capybara::DSL; self }
# cap.visit '/'
# cap.page.find 'h1'
# etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment