aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_test.rb
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2005-10-17 18:17:05 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2005-10-17 18:17:05 +0000
commit2a1a0e52751dc174c39a24bbca6b7bf4b75b10c5 (patch)
treefd318392598653aa0d8ab052931556e2755b9ed6 /activerecord/test/associations_test.rb
parentcb8bb70aa7fa100ea04b8de39fa5fcb99271758d (diff)
downloadrails-2a1a0e52751dc174c39a24bbca6b7bf4b75b10c5.tar.gz
rails-2a1a0e52751dc174c39a24bbca6b7bf4b75b10c5.tar.bz2
rails-2a1a0e52751dc174c39a24bbca6b7bf4b75b10c5.zip
Fixed a few sqlserver test case errors. Closes #2486
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-xactiverecord/test/associations_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb
index ff687fcd77..47562f9176 100755
--- a/activerecord/test/associations_test.rb
+++ b/activerecord/test/associations_test.rb
@@ -1221,7 +1221,7 @@ class HasAndBelongsToManyAssociationsTest < Test::Unit::TestCase
# SQL Server doesn't have a separate column type just for dates,
# so the time is in the string and incorrectly formatted
if ActiveRecord::ConnectionAdapters.const_defined? :SQLServerAdapter and ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::SQLServerAdapter)
- assert_equal Time.mktime(2004, 10, 10).strftime("%Y/%m/%d 00:00:00"), Developer.find(1).projects.first.joined_on.strftime("%Y/%m/%d 00:00:00")
+ assert_equal Time.mktime(2004, 10, 10).strftime("%Y/%m/%d 00:00:00"), Time.parse(Developer.find(1).projects.first.joined_on).strftime("%Y/%m/%d 00:00:00")
else
assert_equal Date.new(2004, 10, 10).to_s, Developer.find(1).projects.first.joined_on.to_s
end
@@ -1242,8 +1242,8 @@ class HasAndBelongsToManyAssociationsTest < Test::Unit::TestCase
# SQL Server doesn't have a separate column type just for dates,
# so the time is in the string and incorrectly formatted
if ActiveRecord::ConnectionAdapters.const_defined? :SQLServerAdapter and ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::SQLServerAdapter)
- assert_equal Time.now.strftime("%Y/%m/%d 00:00:00"), jamis.projects.select { |p| p.name == projects(:action_controller).name }.first.joined_on.strftime("%Y/%m/%d 00:00:00")
- assert_equal Time.now.strftime("%Y/%m/%d 00:00:00"), developers(:jamis).projects.select { |p| p.name == projects(:action_controller).name }.first.joined_on.strftime("%Y/%m/%d 00:00:00")
+ assert_equal Time.now.strftime("%Y/%m/%d 00:00:00"), Time.parse(jamis.projects.select { |p| p.name == projects(:action_controller).name }.first.joined_on).strftime("%Y/%m/%d 00:00:00")
+ assert_equal Time.now.strftime("%Y/%m/%d 00:00:00"), Time.parse(developers(:jamis).projects.select { |p| p.name == projects(:action_controller).name }.first.joined_on).strftime("%Y/%m/%d 00:00:00")
else
assert_equal Date.today.to_s, jamis.projects.select { |p| p.name == projects(:action_controller).name }.first.joined_on.to_s
assert_equal Date.today.to_s, developers(:jamis).projects.select { |p| p.name == projects(:action_controller).name }.first.joined_on.to_s