diff options
author | Rick Olson <technoweenie@gmail.com> | 2008-04-08 03:45:26 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2008-04-08 03:45:26 +0000 |
commit | 605196c4483bbba932804e78cd6d4166f4e29bbb (patch) | |
tree | 4f682a944ab11aabaf8b9208ff571ebe4aecbd19 /activesupport/test/json | |
parent | 4b68982f649c5b230b3e99954a71404c7cec03c7 (diff) | |
download | rails-605196c4483bbba932804e78cd6d4166f4e29bbb.tar.gz rails-605196c4483bbba932804e78cd6d4166f4e29bbb.tar.bz2 rails-605196c4483bbba932804e78cd6d4166f4e29bbb.zip |
Add config.active_support.escape_html_entities_in_json to allow disabling of html entity escaping. [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9238 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/json')
-rw-r--r-- | activesupport/test/json/encoding_test.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index 290232988a..7bc8eaf06c 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -38,15 +38,18 @@ class TestJSONEncoding < Test::Unit::TestCase StandardDateTests = [[ Date.new(2005,2,1), %("2005-02-01") ]] StandardTimeTests = [[ Time.utc(2005,2,1,15,15,10), %("2005-02-01T15:15:10Z") ]] StandardDateTimeTests = [[ DateTime.civil(2005,2,1,15,15,10), %("2005-02-01T15:15:10+00:00") ]] + StandardStringTests = [[ 'this is the <string>', %("this is the <string>")]] constants.grep(/Tests$/).each do |class_tests| define_method("test_#{class_tests[0..-6].underscore}") do begin + ActiveSupport.escape_html_entities_in_json = class_tests !~ /^Standard/ ActiveSupport.use_standard_json_time_format = class_tests =~ /^Standard/ self.class.const_get(class_tests).each do |pair| assert_equal pair.last, pair.first.to_json end ensure + ActiveSupport.escape_html_entities_in_json = false ActiveSupport.use_standard_json_time_format = false end end |