提交 92534179 编写于 作者: Y Yves Senn

pg tests, get rid of `sql_types_test.rb`.

上级 48e3edf9
......@@ -28,6 +28,13 @@ def test_column
assert_equal :binary, @column.type
end
def test_binary_columns_are_limitless_the_upper_limit_is_one_GB
assert_equal 'bytea', @connection.type_to_sql(:binary, 100_000)
assert_raise ActiveRecord::ActiveRecordError do
@connection.type_to_sql :binary, 4294967295
end
end
def test_type_cast_binary_converts_the_encoding
assert @column
......
......@@ -94,6 +94,13 @@ def test_update_oid
assert @first_oid.reload
assert_equal new_value, @first_oid.obj_id
end
def test_text_columns_are_limitless_the_upper_limit_is_one_GB
assert_equal 'text', @connection.type_to_sql(:text, 100_000)
assert_raise ActiveRecord::ActiveRecordError do
@connection.type_to_sql :text, 4294967295
end
end
end
class PostgresqlInternalDataTypeTest < ActiveRecord::TestCase
......
require "cases/helper"
class SqlTypesTest < ActiveRecord::TestCase
def test_binary_types
assert_equal 'bytea', type_to_sql(:binary, 100_000)
assert_raise ActiveRecord::ActiveRecordError do
type_to_sql :binary, 4294967295
end
assert_equal 'text', type_to_sql(:text, 100_000)
assert_raise ActiveRecord::ActiveRecordError do
type_to_sql :text, 4294967295
end
end
def type_to_sql(*args)
ActiveRecord::Base.connection.type_to_sql(*args)
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册