Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add failing test that shows that AR::Migration.remove_column fails si…

…lently with SQLite when passed arguments as symbols.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit f43d97a860de396d4f087c122d8e4f714aaed42c 1 parent 4d6ad9c
Marcel Molina authored
Showing with 17 additions and 3 deletions.
  1. +17 −3 activerecord/test/migration_test.rb
View
20 activerecord/test/migration_test.rb
@@ -132,15 +132,29 @@ def test_native_types
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)
Please sign in to comment.
Something went wrong with that request. Please try again.