From e106dbf0394b75b41139351b74072d5650d1ef74 Mon Sep 17 00:00:00 2001 From: Joey Butler Date: Wed, 18 May 2011 14:32:18 -0400 Subject: Add failing test case for issue 796 --- .../cases/associations/has_many_through_associations_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index 89117593fd..29f574405e 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -766,4 +766,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase assert_equal [category.name], post.named_category_ids # checks when target loaded assert_equal [category.name], post.reload.named_category_ids # checks when target no loaded end + + def test_create_should_not_raise_exception_when_join_record_has_errors + repair_validations(Categorization) do + Categorization.validate { |r| r.errors[:base] << 'Invalid Categorization' } + assert_nothing_raised do + Category.create(:name => 'Fishing', :authors => [Author.first]) + end + end + end end -- cgit v1.2.3