Avoid use of deprecated methods on error objects
[rails.git] / test / unit / message_test.rb
index d40d85f30b15f4350b457ea1b88baf0a31ef36ac..58523ca885ec1e67b2d002b315892fd0bbbbec6b 100644 (file)
@@ -15,9 +15,9 @@ class MessageTest < ActiveSupport::TestCase
   def test_check_empty_message_fails
     message = Message.new
     assert !message.valid?
-    assert message.errors.invalid?(:title)
-    assert message.errors.invalid?(:body)
-    assert message.errors.invalid?(:sent_on)
+    assert message.errors[:title].any?
+    assert message.errors[:body].any?
+    assert message.errors[:sent_on].any?
     assert true, message.message_read
   end