Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source
Show
Ignore:
Timestamp:
04/08/08 03:45:26 (5 months ago)
Author:
rick
Message:

Add config.active_support.escape_html_entities_in_json to allow disabling of html entity escaping. [rick]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/test/json/encoding_test.rb

    r9203 r9238  
    3939  StandardTimeTests     = [[ Time.utc(2005,2,1,15,15,10), %("2005-02-01T15:15:10Z") ]] 
    4040  StandardDateTimeTests = [[ DateTime.civil(2005,2,1,15,15,10), %("2005-02-01T15:15:10+00:00") ]] 
     41  StandardStringTests   = [[ 'this is the <string>', %("this is the <string>")]] 
    4142 
    4243  constants.grep(/Tests$/).each do |class_tests| 
    4344    define_method("test_#{class_tests[0..-6].underscore}") do 
    4445      begin 
     46        ActiveSupport.escape_html_entities_in_json  = class_tests !~ /^Standard/ 
    4547        ActiveSupport.use_standard_json_time_format = class_tests =~ /^Standard/ 
    4648        self.class.const_get(class_tests).each do |pair| 
     
    4850        end 
    4951      ensure 
     52        ActiveSupport.escape_html_entities_in_json  = false 
    5053        ActiveSupport.use_standard_json_time_format = false 
    5154      end