diff options
author | Marcel Molina <marcel@vernix.org> | 2005-09-28 17:50:28 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2005-09-28 17:50:28 +0000 |
commit | f43d97a860de396d4f087c122d8e4f714aaed42c (patch) | |
tree | b15f3c6c8ba197c6e42641905b1867e0987f625f /activerecord | |
parent | 4d6ad9c48b7086bdd71f8da534d4e85ca77230be (diff) | |
download | rails-f43d97a860de396d4f087c122d8e4f714aaed42c.tar.gz rails-f43d97a860de396d4f087c122d8e4f714aaed42c.tar.bz2 rails-f43d97a860de396d4f087c122d8e4f714aaed42c.zip |
Add failing test that shows that AR::Migration.remove_column fails silently with SQLite when passed arguments as symbols.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/migration_test.rb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/activerecord/test/migration_test.rb b/activerecord/test/migration_test.rb index 5a86a678cd..cbcaff8cc4 100644 --- a/activerecord/test/migration_test.rb +++ b/activerecord/test/migration_test.rb @@ -132,15 +132,29 @@ if ActiveRecord::Base.connection.supports_migrations? assert_equal TrueClass, bob.male?.class end - def test_add_remove_single_field + def test_add_remove_single_field_using_string_arguments assert !Person.column_methods_hash.include?(:last_name) - PeopleHaveLastNames.up + ActiveRecord::Migration.add_column 'people', 'last_name', :string Person.reset_column_information assert Person.column_methods_hash.include?(:last_name) - PeopleHaveLastNames.down + ActiveRecord::Migration.remove_column 'people', 'last_name' + + Person.reset_column_information + assert !Person.column_methods_hash.include?(:last_name) + end + + def test_add_remove_single_field_using_symbol_arguments + assert !Person.column_methods_hash.include?(:last_name) + + ActiveRecord::Migration.add_column :people, :last_name, :string + + Person.reset_column_information + assert Person.column_methods_hash.include?(:last_name) + + ActiveRecord::Migration.remove_column :people, :last_name Person.reset_column_information assert !Person.column_methods_hash.include?(:last_name) |