diff options
Diffstat (limited to 'actionpack/test/journey/router_test.rb')
-rw-r--r-- | actionpack/test/journey/router_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb index db2d3bc10d..1a2106a3c5 100644 --- a/actionpack/test/journey/router_test.rb +++ b/actionpack/test/journey/router_test.rb @@ -9,6 +9,7 @@ module ActionDispatch def initialize super({}) end + def dispatcher?; true; end end attr_reader :routes @@ -217,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 |