提交 63091cef 编写于 作者: R Raimonds Simanovskis 提交者: Michael Koziarski

disabled base_test.rb tests that were not Oracle compatible (TIME datatype is...

disabled base_test.rb tests that were not Oracle compatible (TIME datatype is not supported on Oracle, UPDATE does not support ORDER BY) _before_type_cast on Oracle returns Time and not String added Oracle specific schema definition that was missing for test_default_values test
Signed-off-by: NMichael Koziarski <michael@koziarski.com>
上级 1d57ccbc
......@@ -146,7 +146,12 @@ def test_read_attributes_before_type_cast_on_boolean
def test_read_attributes_before_type_cast_on_datetime
developer = Developer.find(:first)
# Oracle adapter returns Time before type cast
unless current_adapter?(:OracleAdapter)
assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"]
else
assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast["created_at"].to_s(:db)
end
end
def test_hash_content
......@@ -682,6 +687,8 @@ def test_update_all_with_order_and_limit
end
end
# Oracle UPDATE does not support ORDER BY
unless current_adapter?(:OracleAdapter)
def test_update_all_ignores_order_without_limit_from_association
author = authors(:david)
assert_nothing_raised do
......@@ -699,6 +706,7 @@ def test_update_all_with_order_and_limit_updates_subset_only
assert_not_equal "bulk update!", posts(:thinking).body
end
end
end
def test_update_many
topic_data = { 1 => { "content" => "1 updated" }, 2 => { "content" => "2 updated" } }
......@@ -1117,6 +1125,8 @@ def test_multiparameter_attributes_on_time_with_skip_time_zone_conversion_for_at
Topic.skip_time_zone_conversion_for_attributes = []
end
# Oracle, and Sybase do not have a TIME datatype.
unless current_adapter?(:OracleAdapter, :SybaseAdapter)
def test_multiparameter_attributes_on_time_only_column_with_time_zone_aware_attributes_does_not_do_time_zone_conversion
ActiveRecord::Base.time_zone_aware_attributes = true
ActiveRecord::Base.default_timezone = :utc
......@@ -1134,6 +1144,7 @@ def test_multiparameter_attributes_on_time_only_column_with_time_zone_aware_attr
ActiveRecord::Base.default_timezone = :local
Time.zone = nil
end
end
def test_multiparameter_attributes_on_time_with_empty_seconds
attributes = {
......
ActiveRecord::Schema.define do
execute "drop table test_oracle_defaults" rescue nil
execute "drop sequence test_oracle_defaults_seq" rescue nil
execute <<-SQL
create table test_oracle_defaults (
id integer not null primary key,
test_char char(1) default 'X' not null,
test_string varchar2(20) default 'hello' not null,
test_int integer default 3 not null
)
SQL
execute <<-SQL
create sequence test_oracle_defaults_seq minvalue 10000
SQL
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册