From 816522ecd8615bf96e8b932ac358fe9346b286ee Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Wed, 11 Jul 2007 23:54:43 +0000 Subject: Make create! on a has_many :through association return the association object. Not the collection. Closes #8786 [lifofifo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations/join_model_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/test/associations') diff --git a/activerecord/test/associations/join_model_test.rb b/activerecord/test/associations/join_model_test.rb index 2e1b4dae88..a784a8eefd 100644 --- a/activerecord/test/associations/join_model_test.rb +++ b/activerecord/test/associations/join_model_test.rb @@ -422,7 +422,7 @@ class AssociationsJoinModelTest < Test::Unit::TestCase assert_equal(count + 1, post_thinking.tags.size) assert_equal(count + 1, post_thinking.tags(true).size) - assert_nothing_raised { post_thinking.tags.create!(:name => 'foo') } + assert_kind_of Tag, post_thinking.tags.create!(:name => 'foo') assert_nil( wrong = post_thinking.tags.detect { |t| t.class != Tag }, message = "Expected a Tag in tags collection, got #{wrong.class}.") assert_nil( wrong = post_thinking.taggings.detect { |t| t.class != Tagging }, -- cgit v1.2.3