diff options
author | brainopia <brainopia@evilmartians.com> | 2015-01-15 16:26:50 +0300 |
---|---|---|
committer | brainopia <brainopia@evilmartians.com> | 2015-01-21 23:53:38 +0300 |
commit | ee6e13f3da11b21f3966e009b681d05c65f79c9e (patch) | |
tree | b65687b71ad2b041da6c9ebabef3e4fcf2f9b30b /actionpack/test | |
parent | 3f96b6973b82ad17e443dd1d21be05996fb6fbf0 (diff) | |
download | rails-ee6e13f3da11b21f3966e009b681d05c65f79c9e.tar.gz rails-ee6e13f3da11b21f3966e009b681d05c65f79c9e.tar.bz2 rails-ee6e13f3da11b21f3966e009b681d05c65f79c9e.zip |
Add `ActionController::Metal#set_request!`
Add `ActionController::Metal#set_request!` to set a request
on controller instance without calling dispatch.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/new_base/bare_metal_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_base/bare_metal_test.rb b/actionpack/test/controller/new_base/bare_metal_test.rb index 246ba099af..710c428dcc 100644 --- a/actionpack/test/controller/new_base/bare_metal_test.rb +++ b/actionpack/test/controller/new_base/bare_metal_test.rb @@ -31,6 +31,15 @@ module BareMetalTest controller.index assert_equal ["Hello world"], controller.response_body end + + test "connect a request to controller instance without dispatch" do + env = {} + controller = BareController.new + controller.set_request! ActionDispatch::Request.new(env) + assert controller.request + assert controller.response + assert env['action_controller.instance'] + end end class HeadController < ActionController::Metal |