diff options
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index d748e80695..2453d6cf58 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -45,7 +45,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase fixtures :accounts, :categories, :companies, :developers, :projects, :developers_projects, :topics, :authors, :comments, :people, :posts, :readers, :taggings, :cars, :essays, - :categorizations, :jobs, :tags, :posts + :categorizations, :jobs, :tags def setup Client.destroyed_client_ids.clear @@ -1886,11 +1886,12 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end end - test 'has_many_association passes context validation to validate children' do + test 'passes custom context validation to validate children' do pirate = FamousPirate.new pirate.famous_ships << ship = FamousShip.new - assert_equal true, pirate.valid? - assert_equal false, pirate.valid?(:conference) + + assert pirate.valid? + assert_not pirate.valid?(:conference) assert_equal "can't be blank", ship.errors[:name].first end end |