aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-11-10 09:37:58 -0800
committerJosé Valim <jose.valim@gmail.com>2011-11-10 09:37:58 -0800
commit23101de283de13517e30c4c3d1ecc65525264886 (patch)
tree239e573b7155f5f41acf0a43eb7d2a4d33690e46 /activerecord/test/cases/migration_test.rb
parent74233d48e64650c26600f82ac23eb55c39fea342 (diff)
parentb805c71655ada0e3fcf7ccc1cdf3376e55b2b9ce (diff)
downloadrails-23101de283de13517e30c4c3d1ecc65525264886.tar.gz
rails-23101de283de13517e30c4c3d1ecc65525264886.tar.bz2
rails-23101de283de13517e30c4c3d1ecc65525264886.zip
Merge pull request #3600 from vijaydev/migration_arity
Checking the arity of the block passed to create_table
Diffstat (limited to 'activerecord/test/cases/migration_test.rb')
-rw-r--r--activerecord/test/cases/migration_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index e8ad37d437..50242a497c 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -1742,6 +1742,21 @@ if ActiveRecord::Base.connection.supports_migrations?
ensure
Person.connection.drop_table :testings rescue nil
end
+
+ def test_create_table_should_not_have_mixed_syntax
+ assert_raise(NoMethodError) do
+ Person.connection.create_table :testings, :force => true do |t|
+ t.string :foo
+ integer :bar
+ end
+ end
+ assert_raise(NameError) do
+ Person.connection.create_table :testings, :force => true do
+ t.string :foo
+ integer :bar
+ end
+ end
+ end
end # SexierMigrationsTest
class MigrationLoggerTest < ActiveRecord::TestCase