Skip to content

Commit

Permalink
Add tests for postgresql column type mapping updates [rails#4270 stat…
Browse files Browse the repository at this point in the history
…e:resolved]

Signed-off-by: Emilio Tagua <miloops@gmail.com>
  • Loading branch information
Ernie Miller authored and miloops committed Mar 31, 2010
1 parent ccf8311 commit 98bf00d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions activerecord/test/cases/column_definition_test.rb
Expand Up @@ -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

0 comments on commit 98bf00d

Please sign in to comment.