From 3facc8578bed29753d4de9b4320e9de9db6cbd5c Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Fri, 19 Oct 2007 02:25:23 +0000 Subject: Few more tests for Sexy Migrations git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/migration_test.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'activerecord') 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| -- cgit v1.2.3