Created
June 29, 2011 10:42
-
-
Save aisuii/1053629 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
require 'rack' | |
require 'action_controller/request' | |
require 'action_controller/response' | |
require 'action_controller/test_process' | |
module RequestSpecHelper | |
def self.included(closure) | |
closure.send :include, Helpers | |
end | |
module Helpers | |
def mock_request(env = {}, &block) | |
req = ActionController::TestRequest.new(env) | |
block_given? ? req.tap(&block) : req | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment