Skip to content

Instantly share code, notes, and snippets.

@adis-io
Forked from 13k/gist:3086739
Created June 10, 2022 11:30
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 adis-io/022588f1a989bf2dfa23f5aa08decd34 to your computer and use it in GitHub Desktop.
Save adis-io/022588f1a989bf2dfa23f5aa08decd34 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