Skip to content
This repository
Browse code

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 authored March 31, 2010 miloops committed March 31, 2010
17  activerecord/test/cases/column_definition_test.rb
@@ -67,4 +67,21 @@ def test_has_default_should_return_false_for_blog_and_test_data_types
67 67
       assert !text_column.has_default?
68 68
     end
69 69
   end
  70
+
  71
+  if current_adapter?(:PostgreSQLAdapter)
  72
+    def test_bigint_column_should_map_to_integer
  73
+      bigint_column = ActiveRecord::ConnectionAdapters::PostgreSQLColumn.new('number', nil, "bigint")
  74
+      assert_equal bigint_column.type, :integer
  75
+    end
  76
+
  77
+    def test_smallint_column_should_map_to_integer
  78
+      smallint_column = ActiveRecord::ConnectionAdapters::PostgreSQLColumn.new('number', nil, "smallint")
  79
+      assert_equal smallint_column.type, :integer
  80
+    end
  81
+
  82
+    def test_uuid_column_should_map_to_string
  83
+      uuid_column = ActiveRecord::ConnectionAdapters::PostgreSQLColumn.new('unique_id', nil, "uuid")
  84
+      assert_equal uuid_column.type, :string
  85
+    end
  86
+  end
70 87
 end

0 notes on commit 98bf00d

Please sign in to comment.
Something went wrong with that request. Please try again.