aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2011-05-20 13:17:16 +0900
committerAkira Matsuda <ronnie@dio.jp>2011-05-20 13:17:16 +0900
commit696c2ea68d7cdbf7eb15f7dce2d83498ef659eb7 (patch)
tree142c18783cc33a0f707efd2e470edec6f9d995dd
parent993e8c55ca24f0d41364614a0ae3a7d42e216e94 (diff)
downloadrails-696c2ea68d7cdbf7eb15f7dce2d83498ef659eb7.tar.gz
rails-696c2ea68d7cdbf7eb15f7dce2d83498ef659eb7.tar.bz2
rails-696c2ea68d7cdbf7eb15f7dce2d83498ef659eb7.zip
Tests for new create_table DSL
-rw-r--r--activerecord/test/cases/migration_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index bf7565a0d0..111dd01f2b 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -1653,6 +1653,26 @@ if ActiveRecord::Base.connection.supports_migrations?
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