Permalink
Browse files

Tests for new create_table DSL

  • Loading branch information...
1 parent 993e8c5 commit 696c2ea68d7cdbf7eb15f7dce2d83498ef659eb7 @amatsuda amatsuda committed May 20, 2011
Showing with 20 additions and 0 deletions.
  1. +20 −0 activerecord/test/cases/migration_test.rb
View
20 activerecord/test/cases/migration_test.rb
@@ -1653,6 +1653,26 @@ def with_new_table
end # SexyMigrationsTest
+ class SexierMigrationsTest < ActiveRecord::TestCase
+ def test_create_table_with_column_without_block_parameter
+ Person.connection.create_table :testings, :force => true do
+ column :foo, :string
+ end
+ assert Person.connection.column_exists?(:testings, :foo, :string)
+ ensure
+ Person.connection.drop_table :testings rescue nil
+ end
+
+ def test_create_table_with_sexy_column_without_block_parameter
+ Person.connection.create_table :testings, :force => true do
+ integer :bar
+ end
+ assert Person.connection.column_exists?(:testings, :bar, :integer)
+ ensure
+ Person.connection.drop_table :testings rescue nil
+ end
+ end # SexierMigrationsTest
+
class MigrationLoggerTest < ActiveRecord::TestCase
def test_migration_should_be_run_without_logger
previous_logger = ActiveRecord::Base.logger

0 comments on commit 696c2ea

Please sign in to comment.