aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-02 08:44:31 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-02 08:44:48 -0800
commitda6ce2e2532a5209a224201a08f805f62dff8d72 (patch)
tree5e272164a5587b34f26fc1fd8f2f1eeb3638c695 /activerecord
parent96eec090dfd50326146b2f690408fefec50c5111 (diff)
downloadrails-da6ce2e2532a5209a224201a08f805f62dff8d72.tar.gz
rails-da6ce2e2532a5209a224201a08f805f62dff8d72.tar.bz2
rails-da6ce2e2532a5209a224201a08f805f62dff8d72.zip
adding a test for YAML round trip
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/yaml_serialization_test.rb9
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