aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-08-25 03:56:21 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-08-25 03:56:21 +0000
commitee2397036fc8d4a9498617349fb391389d8bb933 (patch)
treec1490e0410b3ea09b2128885bf8905c1acd0b380 /activerecord/test
parent91dff3004192c2b94c17078f36b7d9fc35c1cf27 (diff)
downloadrails-ee2397036fc8d4a9498617349fb391389d8bb933.tar.gz
rails-ee2397036fc8d4a9498617349fb391389d8bb933.tar.bz2
rails-ee2397036fc8d4a9498617349fb391389d8bb933.zip
SQLServer: work around bug where some unambiguous date formats are not correctly identified if the session language is set to german. Closes #5894.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4816 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/adapter_test_sqlserver.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/activerecord/test/adapter_test_sqlserver.rb b/activerecord/test/adapter_test_sqlserver.rb
index 11f244e9f7..bf74671209 100644
--- a/activerecord/test/adapter_test_sqlserver.rb
+++ b/activerecord/test/adapter_test_sqlserver.rb
@@ -5,11 +5,25 @@ require 'fixtures/task'
class SqlServerAdapterTest < Test::Unit::TestCase
fixtures :posts, :tasks
-
+
def setup
@connection = ActiveRecord::Base.connection
end
-
+
+ def teardown
+ @connection.execute("SET LANGUAGE us_english")
+ end
+
+ # SQL Server 2000 has a bug where some unambiguous date formats are not
+ # correctly identified if the session language is set to german
+ def test_date_insertion_when_language_is_german
+ @connection.execute("SET LANGUAGE deutsch")
+
+ assert_nothing_raised do
+ Task.create(:starting => Time.utc(2000, 1, 31, 5, 42, 0), :ending => Date.new(2006, 12, 31))
+ end
+ end
+
def test_execute_without_block_closes_statement
assert_all_statements_used_are_closed do
@connection.execute("SELECT 1")