From c32fa73ea15d0d1b355b1f88f82757d79f82ba85 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Wed, 15 Mar 2006 02:17:31 +0000 Subject: Unit test fixes for postgresql. Allow to_xml tests to pass in time zones other than CST. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3870 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/adapter_test.rb | 2 +- activerecord/test/base_test.rb | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/activerecord/test/adapter_test.rb b/activerecord/test/adapter_test.rb index 034e9ac45a..9edc7cc640 100644 --- a/activerecord/test/adapter_test.rb +++ b/activerecord/test/adapter_test.rb @@ -53,7 +53,7 @@ class AdapterTest < Test::Unit::TestCase sub = Subscriber.new(:name => 'robert drake') sub.id = 'bob drake' - assert sub.save! + assert_nothing_raised { sub.save! } end end end diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index ba2c3130bf..226f163b52 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1156,14 +1156,16 @@ class BasicsTest < Test::Unit::TestCase def test_to_xml xml = topics(:first).to_xml(:indent => 0, :skip_instruct => true) + bonus_time_in_current_timezone = topics(:first).bonus_time.xmlschema + written_on_in_current_timezone = topics(:first).written_on.xmlschema assert_equal "", xml.first(7) assert xml.include?(%(The First Topic)) assert xml.include?(%(David)) assert xml.include?(%(1)) assert xml.include?(%(false)), "Approved should be a boolean" assert xml.include?(%(0)) - assert xml.include?(%(2000-01-01 08:28:00)) - assert xml.include?(%(2003-07-16 09:28:00)) + assert xml.include?(%(#{bonus_time_in_current_timezone})) + assert xml.include?(%(#{written_on_in_current_timezone})) assert xml.include?(%(Have a nice day)) assert xml.include?(%(david@loudthinking.com)) assert xml.include?(%()) -- cgit v1.2.3