diff options
author | lulalala <mark@goodlife.tw> | 2019-01-12 21:03:22 +0800 |
---|---|---|
committer | lulalala <mark@goodlife.tw> | 2019-03-31 22:59:13 +0800 |
commit | e7834214a668cde0a4f7757f7f4a3d78f73f2fd8 (patch) | |
tree | b84d2e49b8677faff0c69ae6808d4de0acc1504f /activemodel/test/cases | |
parent | 90815b12c51284b497d55ef52ce4e962f5d33f7f (diff) | |
download | rails-e7834214a668cde0a4f7757f7f4a3d78f73f2fd8.tar.gz rails-e7834214a668cde0a4f7757f7f4a3d78f73f2fd8.tar.bz2 rails-e7834214a668cde0a4f7757f7f4a3d78f73f2fd8.zip |
Fix equality comparison raising error bug
Diffstat (limited to 'activemodel/test/cases')
-rw-r--r-- | activemodel/test/cases/error_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activemodel/test/cases/error_test.rb b/activemodel/test/cases/error_test.rb index d1193d123f..d74321fee5 100644 --- a/activemodel/test/cases/error_test.rb +++ b/activemodel/test/cases/error_test.rb @@ -190,4 +190,11 @@ class ErrorTest < ActiveModel::TestCase assert error != ActiveModel::Error.new(person, :title, foo: :bar) assert error != ActiveModel::Error.new(Person.new, :name, foo: :bar) end + + test "comparing against different class would not raise error" do + person = Person.new + error = ActiveModel::Error.new(person, :name, foo: :bar) + + assert error != person + end end |