Permalink
Browse files

Add failing test case for issue 796

  • Loading branch information...
1 parent c4a9467 commit e106dbf0394b75b41139351b74072d5650d1ef74 @JoeyButler JoeyButler committed with tenderlove May 18, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -766,4 +766,13 @@ def test_primary_key_option_on_source
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

0 comments on commit e106dbf

Please sign in to comment.