Created
July 7, 2010 03:32
-
-
Save paulelliott/466263 to your computer and use it in GitHub Desktop.
RSpec Integration Example Group for Capybara
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 '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