File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ # encoding: UTF-8
1
2
require 'erb'
2
3
require 'abstract_unit'
3
4
require 'controller/fake_controllers'
@@ -2544,3 +2545,22 @@ def app; Routes end
2544
2545
assert_equal 'a b/c+d' , @response . body
2545
2546
end
2546
2547
end
2548
+
2549
+ class TestUnicodePaths < ActionDispatch ::IntegrationTest
2550
+ Routes = ActionDispatch ::Routing ::RouteSet . new . tap do |app |
2551
+ app . draw do
2552
+ match "/#{ Rack ::Utils . escape ( "ほげ" ) } " => lambda { |env |
2553
+ path_params = env [ 'action_dispatch.request.path_parameters' ]
2554
+ [ 200 , { 'Content-Type' => 'text/plain' } , [ ] ]
2555
+ } , :as => :unicode_path
2556
+ end
2557
+ end
2558
+
2559
+ include Routes . url_helpers
2560
+ def app ; Routes end
2561
+
2562
+ test 'recognizes unicode path' do
2563
+ get "/#{ Rack ::Utils . escape ( "ほげ" ) } "
2564
+ assert_equal "200" , @response . code
2565
+ end
2566
+ end
You can’t perform that action at this time.
0 commit comments