diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-08-18 08:46:16 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-08-18 08:48:22 +0200 |
commit | 57498e6f5753ac1d092e1623bed4ee0fdac50480 (patch) | |
tree | 2f19bd52e8e07645be223a44d6bfd75086a3be18 /activerecord/test/cases/associations | |
parent | 88a1800526855edfc42209d4960b48550212fd8f (diff) | |
parent | 820726704d2b2b4ba040b7ab54f9f626b622247e (diff) | |
download | rails-57498e6f5753ac1d092e1623bed4ee0fdac50480.tar.gz rails-57498e6f5753ac1d092e1623bed4ee0fdac50480.tar.bz2 rails-57498e6f5753ac1d092e1623bed4ee0fdac50480.zip |
Merge pull request #21284 from prakashlaxkar/argument_error_tests
Correct error message in Standard American english and add a test cas…
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index ffbf60e390..8ed7b4e39f 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -1325,6 +1325,14 @@ class EagerAssociationTest < ActiveRecord::TestCase assert_match message, error.message end + test "preload with invalid argument" do + exception = assert_raises(ArgumentError) do + Author.preload(10).to_a + end + assert_equal('10 was not recognized for preload', exception.message) + end + + test "preloading readonly association" do # has-one firm = Firm.where(id: "1").preload(:readonly_account).first! |