Permalink
Browse files

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
  • Loading branch information...
1 parent 9de8103 commit c32fa73ea15d0d1b355b1f88f82757d79f82ba85 @NZKoz NZKoz committed Mar 15, 2006
Showing with 5 additions and 3 deletions.
  1. +1 −1 activerecord/test/adapter_test.rb
  2. +4 −2 activerecord/test/base_test.rb
@@ -53,7 +53,7 @@ def test_reset_table_with_non_integer_pk
sub = Subscriber.new(:name => 'robert drake')
sub.id = 'bob drake'
- assert sub.save!
+ assert_nothing_raised { sub.save! }
end
end
end
@@ -1156,14 +1156,16 @@ def test_assert_queries
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>))

0 comments on commit c32fa73

Please sign in to comment.