aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2006-03-15 02:17:31 +0000
committerMichael Koziarski <michael@koziarski.com>2006-03-15 02:17:31 +0000
commitc32fa73ea15d0d1b355b1f88f82757d79f82ba85 (patch)
treed139948ba035b6e5f20245f6af7563fd1001699d
parent9de81036dd31c9b02c63586e598214507feff501 (diff)
downloadrails-c32fa73ea15d0d1b355b1f88f82757d79f82ba85.tar.gz
rails-c32fa73ea15d0d1b355b1f88f82757d79f82ba85.tar.bz2
rails-c32fa73ea15d0d1b355b1f88f82757d79f82ba85.zip
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
-rw-r--r--activerecord/test/adapter_test.rb2
-rwxr-xr-xactiverecord/test/base_test.rb6
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 "<topic>", xml.first(7)
assert xml.include?(%(<title>The First Topic</title>))
assert xml.include?(%(<author-name>David</author-name>))
assert xml.include?(%(<id type="integer">1</id>))
assert xml.include?(%(<approved type="boolean">false</approved>)), "Approved should be a boolean"
assert xml.include?(%(<replies-count type="integer">0</replies-count>))
- assert xml.include?(%(<bonus-time type="datetime">2000-01-01 08:28:00</bonus-time>))
- assert xml.include?(%(<written-on type="datetime">2003-07-16 09:28:00</written-on>))
+ assert xml.include?(%(<bonus-time type="datetime">#{bonus_time_in_current_timezone}</bonus-time>))
+ assert xml.include?(%(<written-on type="datetime">#{written_on_in_current_timezone}</written-on>))
assert xml.include?(%(<content>Have a nice day</content>))
assert xml.include?(%(<author-email-address>david@loudthinking.com</author-email-address>))
assert xml.include?(%(<parent-id></parent-id>))