aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-10-19 02:25:23 +0000
committerMichael Koziarski <michael@koziarski.com>2007-10-19 02:25:23 +0000
commit3facc8578bed29753d4de9b4320e9de9db6cbd5c (patch)
tree27aebb08ae364eea09c4550ba3829afc7f1fb928 /activerecord
parent637c685a42c8dc54b198b985ae55b75380e7f114 (diff)
downloadrails-3facc8578bed29753d4de9b4320e9de9db6cbd5c.tar.gz
rails-3facc8578bed29753d4de9b4320e9de9db6cbd5c.tar.bz2
rails-3facc8578bed29753d4de9b4320e9de9db6cbd5c.zip
Few more tests for Sexy Migrations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/migration_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/activerecord/test/migration_test.rb b/activerecord/test/migration_test.rb
index 5898a290f5..e95d39ce5d 100644
--- a/activerecord/test/migration_test.rb
+++ b/activerecord/test/migration_test.rb
@@ -894,6 +894,30 @@ if ActiveRecord::Base.connection.supports_migrations?
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|