Few more tests for Sexy Migrations

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Michael Koziarski 2007-10-19 02:25:23 +00:00
parent 637c685a42
commit 3facc8578b

@ -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|