Skip to content

Instantly share code, notes, and snippets.

@shenie
Created July 8, 2011 01:46
Show Gist options
  • Save shenie/1070942 to your computer and use it in GitHub Desktop.
Save shenie/1070942 to your computer and use it in GitHub Desktop.
Standalone capybara+rspec
require 'active_record'
require 'mysql2'
require 'capybara'
require 'rspec'
require 'capybara/rspec'
include Capybara::DSL
Capybara.default_driver = Capybara.javascript_driver
ActiveRecord::Base.establish_connection :adapter => 'mysql2' #, ....credentials
def query(sql)
ActiveRecord::Base.connection.execute(sql).to_a(:as => :hash)
end
APP_BASE_URL = "http://yourapp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment