Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add failing test case for issue 796

  • Loading branch information...
commit e106dbf0394b75b41139351b74072d5650d1ef74 1 parent c4a9467
@JoeyButler JoeyButler authored tenderlove committed
View
9 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
Please sign in to comment.
Something went wrong with that request. Please try again.