Permalink
Browse files

Don't rely on T::U::TestCase#name

  • Loading branch information...
jeremy committed Aug 8, 2009
1 parent 482a6f7 commit 019ed5a7c0aac4f1a5924b4a575438f12be18f11
Showing with 5 additions and 4 deletions.
  1. +5 −4 activerecord/test/cases/migration_test.rb
@@ -737,19 +737,20 @@ def test_rename_table_with_an_index
def test_change_column
Person.connection.add_column 'people', 'age', :integer
- old_columns = Person.connection.columns(Person.table_name, "#{name} Columns")
+ label = "test_change_column Columns"
+ old_columns = Person.connection.columns(Person.table_name, label)
assert old_columns.find { |c| c.name == 'age' and c.type == :integer }
assert_nothing_raised { Person.connection.change_column "people", "age", :string }
- new_columns = Person.connection.columns(Person.table_name, "#{name} Columns")
+ new_columns = Person.connection.columns(Person.table_name, label)
assert_nil new_columns.find { |c| c.name == 'age' and c.type == :integer }
assert new_columns.find { |c| c.name == 'age' and c.type == :string }
- old_columns = Topic.connection.columns(Topic.table_name, "#{name} Columns")
+ old_columns = Topic.connection.columns(Topic.table_name, label)
assert old_columns.find { |c| c.name == 'approved' and c.type == :boolean and c.default == true }
assert_nothing_raised { Topic.connection.change_column :topics, :approved, :boolean, :default => false }
- new_columns = Topic.connection.columns(Topic.table_name, "#{name} Columns")
+ new_columns = Topic.connection.columns(Topic.table_name, label)
assert_nil new_columns.find { |c| c.name == 'approved' and c.type == :boolean and c.default == true }
assert new_columns.find { |c| c.name == 'approved' and c.type == :boolean and c.default == false }
assert_nothing_raised { Topic.connection.change_column :topics, :approved, :boolean, :default => true }

0 comments on commit 019ed5a

Please sign in to comment.