aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJoey Butler <joey.butler.1987@gmail.com>2011-05-18 14:32:18 -0400
committerAaron Patterson <aaron.patterson@gmail.com>2011-05-24 10:59:37 -0700
commite106dbf0394b75b41139351b74072d5650d1ef74 (patch)
tree81a37c15a8197c819057e28c1db43a748c791ccf /activerecord
parentc4a9467af4f2e08db50b350a6ffca9bf4026ef59 (diff)
downloadrails-e106dbf0394b75b41139351b74072d5650d1ef74.tar.gz
rails-e106dbf0394b75b41139351b74072d5650d1ef74.tar.bz2
rails-e106dbf0394b75b41139351b74072d5650d1ef74.zip
Add failing test case for issue 796
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb9
1 files changed, 9 insertions, 0 deletions
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