aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/yaml_serialization_test.rb
blob: f221def6b63bf165f5ceed2d3ced70fbb6f50ff3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
require "cases/helper"
require 'models/topic'

class YamlSerializationTest < ActiveRecord::TestCase
  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
end