diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-25 14:26:48 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-25 14:26:48 -0700 |
commit | b18f22d15c28fc5fe634928d59148c932bba4696 (patch) | |
tree | 082cbcd84dacfc506a121c8b42f4fc4a5446ae74 /actionpack/test/journey | |
parent | 62c013d7b18d726d0ce10c3e7a1208d5e0e7fadf (diff) | |
download | rails-b18f22d15c28fc5fe634928d59148c932bba4696.tar.gz rails-b18f22d15c28fc5fe634928d59148c932bba4696.tar.bz2 rails-b18f22d15c28fc5fe634928d59148c932bba4696.zip |
pass the request object to the application
Diffstat (limited to 'actionpack/test/journey')
-rw-r--r-- | actionpack/test/journey/router_test.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb index 561c547b44..1a2106a3c5 100644 --- a/actionpack/test/journey/router_test.rb +++ b/actionpack/test/journey/router_test.rb @@ -218,13 +218,16 @@ module ActionDispatch end def test_clear_trailing_slash_from_script_name_on_root_unanchored_routes + route_set = Routing::RouteSet.new + mapper = Routing::Mapper.new route_set + strexp = Router::Strexp.new("/", {}, ['/', '.', '?'], false) path = Path::Pattern.new strexp app = lambda { |env| [200, {}, ['success!']] } - @router.routes.add_route(app, path, {}, {}, {}) + mapper.get '/weblog', :to => app env = rack_env('SCRIPT_NAME' => '', 'PATH_INFO' => '/weblog') - resp = @router.serve rails_env env + resp = route_set.call env assert_equal ['success!'], resp.last assert_equal '', env['SCRIPT_NAME'] end |