Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Test for unicode path support #4658

Merged
merged 1 commit into from

3 participants

@pwim

This is a test for a regression from 3.1. This is currently broken due to a bug in journey. I've submitted a pull request to fix it in Journey: (rails/journey#14), but as there was no testing in Rails of this functionality, I'm submitting this request as well.

@pwim pwim Test for unicode path support
This is currently broken due to a bug in journey.
22980e0
@tenderlove tenderlove was assigned
@tenderlove tenderlove merged commit 11e88a4 into rails:3-2-stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 25, 2012
  1. @pwim

    Test for unicode path support

    pwim authored
    This is currently broken due to a bug in journey.
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 0 deletions.
  1. +20 −0 actionpack/test/dispatch/routing_test.rb
View
20 actionpack/test/dispatch/routing_test.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
require 'erb'
require 'abstract_unit'
require 'controller/fake_controllers'
@@ -2542,3 +2543,22 @@ def app; Routes end
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
Something went wrong with that request. Please try again.