aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
diff options
context:
space:
mode:
authorSemyon Pupkov <mail@semyonpupkov.com>2017-09-21 21:07:06 +0500
committerSemyon Pupkov <mail@semyonpupkov.com>2018-04-28 16:27:16 +0500
commit2253f6cca10d5dd474654138e6190481ae764bc6 (patch)
tree4fd7883a98e0bb54ffa97478721ce1ed04fd3604 /activemodel/test
parent276fe661098619239ac90c110b06d72b3fc77b5c (diff)
downloadrails-2253f6cca10d5dd474654138e6190481ae764bc6.tar.gz
rails-2253f6cca10d5dd474654138e6190481ae764bc6.tar.bz2
rails-2253f6cca10d5dd474654138e6190481ae764bc6.zip
Improve error message when assign wrong attributes to model
Diffstat (limited to 'activemodel/test')
-rw-r--r--activemodel/test/cases/attribute_assignment_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activemodel/test/cases/attribute_assignment_test.rb b/activemodel/test/cases/attribute_assignment_test.rb
index b06291f1b4..30e8419685 100644
--- a/activemodel/test/cases/attribute_assignment_test.rb
+++ b/activemodel/test/cases/attribute_assignment_test.rb
@@ -100,9 +100,11 @@ class AttributeAssignmentTest < ActiveModel::TestCase
end
test "an ArgumentError is raised if a non-hash-like object is passed" do
- assert_raises(ArgumentError) do
+ err = assert_raises(ArgumentError) do
Model.new(1)
end
+
+ assert_equal("When assigning attributes, you must pass a hash as an argument, Integer passed.", err.message)
end
test "forbidden attributes cannot be used for mass assignment" do