Test for unicode path support

This is currently broken due to a bug in journey.
This commit is contained in:
Paul McMahon
2012-01-25 15:27:33 +09:00
parent 1d67f1ade7
commit 22980e0c17

View File

@@ -1,3 +1,4 @@
# encoding: UTF-8
require 'erb'
require 'abstract_unit'
require 'controller/fake_controllers'
@@ -2542,3 +2543,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