Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: 2.0.0.a2
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (26 sloc) 0.691 kB
require 'action_dispatch'
require 'webrat'
module ControllerExampleGroupBehaviour
include ActionDispatch::Assertions
include ActionDispatch::Integration::Runner
include Webrat::Matchers
include Webrat::Methods
include Rspec::Rails::Matchers
def self.included(mod)
mod.before { @_result = Struct.new(:add_assertion).new }
end
def app
self.class.described_class.action(@_action)
end
%w[get post put delete head].map do |method|
eval <<-CODE
def #{method}(action)
@_action = action
super '/'
end
CODE
end
Rspec::Core.configure do |c|
c.include self, :behaviour => { :file_path => /\/spec\/controllers\// }
end
end
Jump to Line
Something went wrong with that request. Please try again.