Created
July 8, 2011 01:46
-
-
Save shenie/1070942 to your computer and use it in GitHub Desktop.
Standalone capybara+rspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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