Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10884: drop_table_test.diff

File drop_table_test.diff, 0.7 kB (added by adamwiggins, 7 months ago)

drop_table unit test

  • a/activerecord/test/migration_test.rb

    old new  
    180180      Person.connection.drop_table :testings rescue nil 
    181181    end 
    182182 
     183    def test_drop_table 
     184      Person.connection.create_table :test_drop_table do |t| 
     185        t.column :foo, :string 
     186      end 
     187      Person.connection.drop_table :test_drop_table 
     188      assert !Person.connection.tables.include?(:test_drop_table) 
     189    end 
     190 
    183191    # SQL Server, Sybase, and SQLite3 will not allow you to add a NOT NULL 
    184192    # column to a table without a default value. 
    185193    unless current_adapter?(:SQLServerAdapter, :SybaseAdapter, :SQLiteAdapter)