Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 34 lines (27 sloc) 0.649 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
require 'action_dispatch'
require 'webrat'

module RequestExampleGroupBehaviour
  include ActionDispatch::Assertions
  include ActionDispatch::Integration::Runner
  include Webrat::Matchers
  include Webrat::Methods
  include Rspec::Matchers

  def self.included(mod)
    mod.before do
      @_result = Struct.new(:add_assertion).new
      @router = ::Rails.application.routes
    end
  end
  
  def app
    ::Rails.application
  end

  Webrat.configure do |config|
    config.mode = :rack
  end

  def last_response
    response
  end

  Rspec.configure do |c|
    c.include self, :example_group => { :file_path => /\bspec\/requests\// }
  end
end
Something went wrong with that request. Please try again.