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

Changeset 7975

Show
Ignore:
Timestamp:
10/19/07 02:25:23 (11 months ago)
Author:
nzkoz
Message:

Few more tests for Sexy Migrations

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/test/migration_test.rb

    r7973 r7975  
    895895      end 
    896896       
     897      def test_timestamps_creates_updated_at_and_created_at 
     898        with_new_table do |t| 
     899          t.expects(:column).with(:created_at, :datetime) 
     900          t.expects(:column).with(:updated_at, :datetime) 
     901          t.timestamps 
     902        end 
     903      end 
     904       
     905      def test_integer_creates_integer_column 
     906        with_new_table do |t| 
     907          t.expects(:column).with(:foo, 'integer', {}) 
     908          t.expects(:column).with(:bar, 'integer', {}) 
     909          t.integer :foo, :bar 
     910        end 
     911      end 
     912       
     913      def test_string_creates_string_column 
     914        with_new_table do |t| 
     915          t.expects(:column).with(:foo, 'string', {}) 
     916          t.expects(:column).with(:bar, 'string', {}) 
     917          t.string :foo, :bar 
     918        end 
     919      end 
     920       
    897921      protected 
    898922      def with_new_table