From 643d17ce9e6937425a9e39e6ef6fae07efd15b8a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 29 Sep 2006 07:39:31 +0000 Subject: assert_select_rjs decodes escaped unicode chars since the Javascript generators encode them. Closes #6240. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5202 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/assert_select_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/assert_select_test.rb b/actionpack/test/controller/assert_select_test.rb index bed8da622d..52ef688514 100644 --- a/actionpack/test/controller/assert_select_test.rb +++ b/actionpack/test/controller/assert_select_test.rb @@ -288,6 +288,18 @@ class AssertSelectTest < Test::Unit::TestCase assert_raises(AssertionFailedError) { assert_select_rjs } end + def test_assert_select_rjs_with_unicode + # Test that non-ascii characters (which are converted into \uXXXX in RJS) are decoded correctly. + render_rjs do |page| + page.replace "test", "
\343\203\201\343\202\261\343\203\203\343\203\210
" + end + assert_select_rjs do + assert_select "#1", :text => "\343\203\201\343\202\261\343\203\203\343\203\210" + assert_select "#1", "\343\203\201\343\202\261\343\203\203\343\203\210" + assert_select "#1", Regexp.new("\343\203\201..\343\203\210",0,'U') + assert_raises(AssertionFailedError) { assert_select "#1", Regexp.new("\343\203\201.\343\203\210",0,'U') } + end + end def test_assert_select_rjs_with_id # Test that we can pick up all statements in the result. -- cgit v1.2.3