Created
April 23, 2011 12:49
-
-
Save RSpace/938578 to your computer and use it in GitHub Desktop.
Running Capybara and RSpec without Rails
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
source 'http://rubygems.org' | |
gem 'rspec' | |
gem 'capybara', :git => 'https://github.com/jnicklas/capybara.git' | |
gem 'launchy' | |
gem 'ruby-debug19' |
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 File.dirname(__FILE__) + '/../spec_helper' | |
describe "sign in", :type => :request do | |
it "should sign me in" do | |
# Sign in and make assertions | |
end | |
end |
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 'rubygems' | |
require 'bundler/setup' | |
require 'ruby-debug' | |
require 'rspec' | |
require 'capybara/rspec' | |
Dir.glob(File.dirname(__FILE__) + '/factories/*', &method(:require)) | |
# Capybara configuration | |
Capybara.default_driver = :selenium | |
Capybara.save_and_open_page_path = File.dirname(__FILE__) + '/../snapshots' | |
# RSpec configuration | |
RSpec.configure do |config| | |
config.before(:all) do | |
# Create fixtures | |
end | |
config.after(:all) do | |
# Destroy fixtures | |
end | |
config.around(:each) do |example| | |
begin | |
example.run | |
rescue Exception => ex | |
save_and_open_page | |
raise ex | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment