Skip to content

Instantly share code, notes, and snippets.

@paulelliott
Created July 7, 2010 03:32
Show Gist options
  • Save paulelliott/466263 to your computer and use it in GitHub Desktop.
Save paulelliott/466263 to your computer and use it in GitHub Desktop.
RSpec Integration Example Group for Capybara
require 'action_dispatch'
require 'capybara/rails'
require 'capybara/dsl'
module RSpec::Rails
module IntegrationExampleGroup
extend ActiveSupport::Concern
include ActionDispatch::Integration::Runner
include RSpec::Rails::TestUnitAssertionAdapter
include ActionDispatch::Assertions
include Capybara
include RSpec::Matchers
module InstanceMethods
def app
::Rails.application
end
def last_response
page
end
end
included do
before do
@router = ::Rails.application.routes
end
end
RSpec.configure do |c|
c.include self, :example_group => { :file_path => /\bspec\/integration\// }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment