Skip to content
This repository
Browse code

Merge pull request #8398 from rmascarenhas/active-model-errors-spec-f…

…ixes

ActiveModel::Errors spec fixes
  • Loading branch information...
commit df1484ced51646624c8c602f5a00d6e906c5ca1b 2 parents a777692 + cc62ec1
Rafael Mendonça França rafaelfranca authored

Showing 1 changed file with 2 additions and 3 deletions. Show diff stats Hide diff stats

  1. +2 3 activemodel/test/cases/errors_test.rb
5 activemodel/test/cases/errors_test.rb
@@ -116,7 +116,7 @@ def test_has_key?
116 116
117 117 test "added? should default message to :invalid" do
118 118 person = Person.new
119   - person.errors.add(:name, :invalid)
  119 + person.errors.add(:name)
120 120 assert person.errors.added?(:name)
121 121 end
122 122
@@ -161,7 +161,7 @@ def test_has_key?
161 161 person = Person.new
162 162 person.errors.add(:name, "can not be blank")
163 163 person.errors.add(:name, "can not be nil")
164   - assert_equal ["name can not be blank", "name can not be nil"], person.errors.to_a
  164 + assert_equal ["name can not be blank", "name can not be nil"], person.errors.full_messages
165 165 end
166 166
167 167 test 'full_message should return the given message if attribute equals :base' do
@@ -240,4 +240,3 @@ def test_has_key?
240 240 person.errors.add_on_blank :name, :message => 'custom'
241 241 end
242 242 end
243   -

0 comments on commit df1484c

Please sign in to comment.
Something went wrong with that request. Please try again.