diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-02 08:44:31 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-02 08:44:48 -0800 |
commit | da6ce2e2532a5209a224201a08f805f62dff8d72 (patch) | |
tree | 5e272164a5587b34f26fc1fd8f2f1eeb3638c695 /activerecord/test | |
parent | 96eec090dfd50326146b2f690408fefec50c5111 (diff) | |
download | rails-da6ce2e2532a5209a224201a08f805f62dff8d72.tar.gz rails-da6ce2e2532a5209a224201a08f805f62dff8d72.tar.bz2 rails-da6ce2e2532a5209a224201a08f805f62dff8d72.zip |
adding a test for YAML round trip
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/yaml_serialization_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb index f221def6b6..0fc9918744 100644 --- a/activerecord/test/cases/yaml_serialization_test.rb +++ b/activerecord/test/cases/yaml_serialization_test.rb @@ -2,10 +2,19 @@ require "cases/helper" require 'models/topic' class YamlSerializationTest < ActiveRecord::TestCase + fixtures :topics + def test_to_yaml_with_time_with_zone_should_not_raise_exception Time.zone = ActiveSupport::TimeZone["Pacific Time (US & Canada)"] ActiveRecord::Base.time_zone_aware_attributes = true topic = Topic.new(:written_on => DateTime.now) assert_nothing_raised { topic.to_yaml } end + + def test_roundtrip + topic = Topic.first + assert topic + t = YAML.load YAML.dump topic + assert_equal topic, t + end end |