aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-29 07:39:31 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-29 07:39:31 +0000
commit643d17ce9e6937425a9e39e6ef6fae07efd15b8a (patch)
treed46fe1bb7e731de096f61b24683b89d91a4c27d0 /actionpack/test
parentd7674637f9ac7c9764a4fe09dbc15ee239ce5a77 (diff)
downloadrails-643d17ce9e6937425a9e39e6ef6fae07efd15b8a.tar.gz
rails-643d17ce9e6937425a9e39e6ef6fae07efd15b8a.tar.bz2
rails-643d17ce9e6937425a9e39e6ef6fae07efd15b8a.zip
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
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/assert_select_test.rb12
1 files changed, 12 insertions, 0 deletions
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", "<div id=\"1\">\343\203\201\343\202\261\343\203\203\343\203\210</div>"
+ 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.