aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2010-03-31 17:05:34 -0400
committerEmilio Tagua <miloops@gmail.com>2010-03-31 19:22:54 -0300
commit98bf00d50d81c522f747131da7071d02815652f3 (patch)
treef731758dc772c1d78014efdeedcaf005e345bc76
parentccf8311123a448fb82a568a57974d58b6b990837 (diff)
downloadrails-98bf00d50d81c522f747131da7071d02815652f3.tar.gz
rails-98bf00d50d81c522f747131da7071d02815652f3.tar.bz2
rails-98bf00d50d81c522f747131da7071d02815652f3.zip
Add tests for postgresql column type mapping updates [#4270 state:resolved]
Signed-off-by: Emilio Tagua <miloops@gmail.com>
-rw-r--r--activerecord/test/cases/column_definition_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/test/cases/column_definition_test.rb b/activerecord/test/cases/column_definition_test.rb
index fc9a0ac96e..8b6c019d50 100644
--- a/activerecord/test/cases/column_definition_test.rb
+++ b/activerecord/test/cases/column_definition_test.rb
@@ -67,4 +67,21 @@ class ColumnDefinitionTest < ActiveRecord::TestCase
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