diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-06 00:33:51 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-06 00:33:51 +0000 |
commit | 55640fb939ff76247adad28077ff7e01d3bf463b (patch) | |
tree | dc9e83555dae8afee7e724dd68f57d464ae94bcb /activerecord | |
parent | 5b2e8b1eb1731e987faa233dc03e83c221cfcda5 (diff) | |
download | rails-55640fb939ff76247adad28077ff7e01d3bf463b.tar.gz rails-55640fb939ff76247adad28077ff7e01d3bf463b.tar.bz2 rails-55640fb939ff76247adad28077ff7e01d3bf463b.zip |
Simplify some JSON tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7750 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/json_serialization_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/json_serialization_test.rb b/activerecord/test/json_serialization_test.rb index eb4f90cf0f..3952a22c25 100644 --- a/activerecord/test/json_serialization_test.rb +++ b/activerecord/test/json_serialization_test.rb @@ -23,7 +23,7 @@ class JsonSerializationTest < Test::Unit::TestCase assert_match %r{"name": "Konata Izumi"}, json assert_match %r{"age": 16}, json - assert_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json + assert json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) assert_match %r{"awesome": true}, json assert_match %r{"preferences": \{"shows": "anime"\}}, json end @@ -34,7 +34,7 @@ class JsonSerializationTest < Test::Unit::TestCase assert_match %r{"name": "Konata Izumi"}, json assert_match %r{"age": 16}, json assert_no_match %r{"awesome": true}, json - assert_no_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json + assert !json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) assert_no_match %r{"preferences": \{"shows": "anime"\}}, json end @@ -44,7 +44,7 @@ class JsonSerializationTest < Test::Unit::TestCase assert_no_match %r{"name": "Konata Izumi"}, json assert_no_match %r{"age": 16}, json assert_match %r{"awesome": true}, json - assert_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json + assert json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) assert_match %r{"preferences": \{"shows": "anime"\}}, json end @@ -174,4 +174,4 @@ class DatabaseConnectedJsonEncodingTest < Test::Unit::TestCase assert_equal %({1: {"name": "David"}}), authors_hash.to_json(:only => [1, :name]) end -end
\ No newline at end of file +end |