diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-11-25 15:33:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-25 15:33:03 -0500 |
commit | 89a209f1abba5a2320d31c4898dea150c0abd0c0 (patch) | |
tree | 87a52a13f3e6c350801b72509dbbf16cdc81f70e /activerecord/test/cases/associations | |
parent | 72dec81206a4dfc0f14300fa9d40aea240d5b1da (diff) | |
parent | ae032ec38463e923c0556fbdd28b9d9fced18b11 (diff) | |
download | rails-89a209f1abba5a2320d31c4898dea150c0abd0c0.tar.gz rails-89a209f1abba5a2320d31c4898dea150c0abd0c0.tar.bz2 rails-89a209f1abba5a2320d31c4898dea150c0abd0c0.zip |
Merge pull request #31184 from TheSmartnik/fix_record_not_found_on_reload
Provide arguments to RecordNotFound
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/inverse_associations_test.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/test/cases/associations/inverse_associations_test.rb b/activerecord/test/cases/associations/inverse_associations_test.rb index e13cf93dcf..f8f6b10e2b 100644 --- a/activerecord/test/cases/associations/inverse_associations_test.rb +++ b/activerecord/test/cases/associations/inverse_associations_test.rb @@ -484,7 +484,10 @@ class InverseHasManyTests < ActiveRecord::TestCase def test_raise_record_not_found_error_when_no_ids_are_passed man = Man.create! - assert_raise(ActiveRecord::RecordNotFound) { man.interests.find() } + exception = assert_raise(ActiveRecord::RecordNotFound) { man.interests.load.find() } + + assert_equal exception.model, "Interest" + assert_equal exception.primary_key, "id" end def test_trying_to_use_inverses_that_dont_exist_should_raise_an_error |