mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #4658 from pwim/unicode-paths
Test for unicode path support
This commit is contained in:
parent
0581c1a95c
commit
aa8ebea143
1 changed files with 20 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
# encoding: UTF-8
|
||||
require 'erb'
|
||||
require 'abstract_unit'
|
||||
require 'controller/fake_controllers'
|
||||
|
@ -2544,3 +2545,22 @@ class TestUriPathEscaping < ActionDispatch::IntegrationTest
|
|||
assert_equal 'a b/c+d', @response.body
|
||||
end
|
||||
end
|
||||
|
||||
class TestUnicodePaths < ActionDispatch::IntegrationTest
|
||||
Routes = ActionDispatch::Routing::RouteSet.new.tap do |app|
|
||||
app.draw do
|
||||
match "/#{Rack::Utils.escape("ほげ")}" => lambda { |env|
|
||||
path_params = env['action_dispatch.request.path_parameters']
|
||||
[200, { 'Content-Type' => 'text/plain' }, []]
|
||||
}, :as => :unicode_path
|
||||
end
|
||||
end
|
||||
|
||||
include Routes.url_helpers
|
||||
def app; Routes end
|
||||
|
||||
test 'recognizes unicode path' do
|
||||
get "/#{Rack::Utils.escape("ほげ")}"
|
||||
assert_equal "200", @response.code
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue