diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-08-01 17:59:25 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-08-01 17:59:25 -0300 |
commit | b3c0858f732da157195ad3e2dec470791c754cfe (patch) | |
tree | 5e01e18c660765441745477988c4f68decd78df5 /actionview/test/template | |
parent | 4b87854e541a47a485bb3b34dc6d090a48b8cc9c (diff) | |
download | rails-b3c0858f732da157195ad3e2dec470791c754cfe.tar.gz rails-b3c0858f732da157195ad3e2dec470791c754cfe.tar.bz2 rails-b3c0858f732da157195ad3e2dec470791c754cfe.zip |
Make current_page? compare binary strings
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/url_helper_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb index 9d9bd01de0..d512fa9913 100644 --- a/actionview/test/template/url_helper_test.rb +++ b/actionview/test/template/url_helper_test.rb @@ -408,6 +408,14 @@ class UrlHelperTest < ActiveSupport::TestCase assert current_page?(controller: 'foo', action: 'category', category: 'administração') end + def test_current_page_with_escaped_params_with_different_encoding + @request = request_for_url("/") + @request.stub(:path, "/category/administra%c3%a7%c3%a3o".force_encoding(Encoding::ASCII_8BIT)) do + assert current_page?(:controller => 'foo', :action => 'category', category: 'administração') + assert current_page?("http://www.example.com/category/administra%c3%a7%c3%a3o") + end + end + def test_current_page_with_double_escaped_params @request = request_for_url("/category/administra%c3%a7%c3%a3o?callback_url=http%3a%2f%2fexample.com%2ffoo") |