Rails 2.1 RC1
Updated Instiki to Rails 2.1 RC1 (aka 2.0.991).
This commit is contained in:
parent
14afed5893
commit
5292899c9a
971 changed files with 46318 additions and 17450 deletions
|
@ -1,4 +1,5 @@
|
|||
require File.dirname(__FILE__) + '/../abstract_unit'
|
||||
# encoding: utf-8
|
||||
require 'abstract_unit'
|
||||
|
||||
class TestJSONEncoding < Test::Unit::TestCase
|
||||
class Foo
|
||||
|
@ -34,10 +35,22 @@ class TestJSONEncoding < Test::Unit::TestCase
|
|||
TimeTests = [[ Time.utc(2005,2,1,15,15,10), %("2005/02/01 15:15:10 +0000") ]]
|
||||
DateTimeTests = [[ DateTime.civil(2005,2,1,15,15,10), %("2005/02/01 15:15:10 +0000") ]]
|
||||
|
||||
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].downcase}") do
|
||||
self.class.const_get(class_tests).each do |pair|
|
||||
assert_equal pair.last, pair.first.to_json
|
||||
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
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue