Skip to content
Browse files

Few more tests for Sexy Migrations

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 637c685 commit 3facc8578bed29753d4de9b4320e9de9db6cbd5c @NZKoz NZKoz committed
Showing with 24 additions and 0 deletions.
  1. +24 −0 activerecord/test/migration_test.rb
View
24 activerecord/test/migration_test.rb
@@ -894,6 +894,30 @@ def test_belongs_to_works_like_references
end
end
+ def test_timestamps_creates_updated_at_and_created_at
+ with_new_table do |t|
+ t.expects(:column).with(:created_at, :datetime)
+ t.expects(:column).with(:updated_at, :datetime)
+ t.timestamps
+ end
+ end
+
+ def test_integer_creates_integer_column
+ with_new_table do |t|
+ t.expects(:column).with(:foo, 'integer', {})
+ t.expects(:column).with(:bar, 'integer', {})
+ t.integer :foo, :bar
+ end
+ end
+
+ def test_string_creates_string_column
+ with_new_table do |t|
+ t.expects(:column).with(:foo, 'string', {})
+ t.expects(:column).with(:bar, 'string', {})
+ t.string :foo, :bar
+ end
+ end
+
protected
def with_new_table
Person.connection.create_table :delete_me do |t|

0 comments on commit 3facc85

Please sign in to comment.
Something went wrong with that request. Please try again.