Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add tests for postgresql column type mapping updates [#4270 state:res…

…olved]

Signed-off-by: Emilio Tagua <miloops@gmail.com>
  • Loading branch information...
commit 98bf00d50d81c522f747131da7071d02815652f3 1 parent ccf8311
Ernie Miller ernie authored miloops committed
Showing with 17 additions and 0 deletions.
  1. +17 −0 activerecord/test/cases/column_definition_test.rb
17 activerecord/test/cases/column_definition_test.rb
View
@@ -67,4 +67,21 @@ def test_has_default_should_return_false_for_blog_and_test_data_types
assert !text_column.has_default?
end
end
+
+ if current_adapter?(:PostgreSQLAdapter)
+ def test_bigint_column_should_map_to_integer
+ bigint_column = ActiveRecord::ConnectionAdapters::PostgreSQLColumn.new('number', nil, "bigint")
+ assert_equal bigint_column.type, :integer
+ end
+
+ def test_smallint_column_should_map_to_integer
+ smallint_column = ActiveRecord::ConnectionAdapters::PostgreSQLColumn.new('number', nil, "smallint")
+ assert_equal smallint_column.type, :integer
+ end
+
+ def test_uuid_column_should_map_to_string
+ uuid_column = ActiveRecord::ConnectionAdapters::PostgreSQLColumn.new('unique_id', nil, "uuid")
+ assert_equal uuid_column.type, :string
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.