upgrade to rails 2.3.12 and fix deprecation warning and fix some version numbers of gems used for testing

This commit is contained in:
Reinier Balt 2011-06-09 17:04:00 +02:00
parent a3c5920a2b
commit ceda51b5bf
34 changed files with 2451 additions and 11266 deletions

View file

@ -82,6 +82,15 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert_equal 4, post.comments.length
end
def test_find_or_create_by_with_same_parameters_creates_a_single_record
author = Author.first
assert_difference "Post.count", +1 do
2.times do
author.posts.find_or_create_by_body_and_title('one', 'two')
end
end
end
def test_find_or_create_by_with_block
post = Post.create! :title => 'test_find_or_create_by_with_additional_parameters', :body => 'this is the body'
comment = post.comments.find_or_create_by_body('other test comment body') { |comment| comment.type = 'test' }