@@ -22,11 +22,11 @@ def validate!
2222 # send(attr)
2323 # end
2424
25- class << self
26- def human_attribute_name ( attr , options = { } )
27- attr
28- end
29- end
25+ # class << self
26+ # def human_attribute_name(attr, options = {})
27+ # attr
28+ # end
29+ # end
3030
3131 # def self.lookup_ancestors
3232 # [self]
@@ -174,7 +174,7 @@ def human_attribute_name(attr, options = {})
174174 person = Person . new
175175 person . validate!
176176 person . errors . full_messages
177- end . to eq [ 'name cannot be nil' ]
177+ end . to eq [ 'Name cannot be nil' ]
178178
179179 expect_evaluate_ruby do
180180 person = Person . new
@@ -312,7 +312,7 @@ def human_attribute_name(attr, options = {})
312312 person . errors . add ( :name , 'cannot be blank' )
313313 person . errors . add ( :name , 'cannot be nil' )
314314 person . errors . to_a
315- end . to eq [ 'name cannot be blank' , 'name cannot be nil' ]
315+ end . to eq [ 'Name cannot be blank' , 'Name cannot be nil' ]
316316 end
317317
318318 it 'to_hash returns the error messages hash' do
@@ -343,7 +343,7 @@ def human_attribute_name(attr, options = {})
343343 person . errors . add ( :name , 'cannot be blank' )
344344 person . errors . add ( :name , 'cannot be nil' )
345345 person . errors . full_messages
346- end . to eq [ 'name cannot be blank' , 'name cannot be nil' ]
346+ end . to eq [ 'Name cannot be blank' , 'Name cannot be nil' ]
347347 end
348348
349349 it 'full_messages_for contains all the error messages for the given attribute indifferent' do
@@ -352,7 +352,7 @@ def human_attribute_name(attr, options = {})
352352 person . errors . add ( :name , 'cannot be blank' )
353353 person . errors . add ( :name , 'cannot be nil' )
354354 person . errors . full_messages_for ( :name )
355- end . to eq [ 'name cannot be blank' , 'name cannot be nil' ]
355+ end . to eq [ 'Name cannot be blank' , 'Name cannot be nil' ]
356356 end
357357
358358 it 'full_messages_for does not contain error messages from other attributes' do
@@ -361,7 +361,7 @@ def human_attribute_name(attr, options = {})
361361 person . errors . add ( :name , 'cannot be blank' )
362362 person . errors . add ( :email , 'cannot be blank' )
363363 person . errors . full_messages_for ( :name )
364- end . to eq [ 'name cannot be blank' ]
364+ end . to eq [ 'Name cannot be blank' ]
365365 end
366366
367367 it 'full_messages_for returns an empty list in case there are no errors for the given attribute' do
@@ -383,7 +383,7 @@ def human_attribute_name(attr, options = {})
383383 expect_evaluate_ruby do
384384 person = Person . new
385385 person . errors . full_message ( :name_test , 'cannot be blank' )
386- end . to eq 'name_test cannot be blank'
386+ end . to eq 'Name test cannot be blank'
387387 end
388388
389389 it 'as_json creates a json formatted representation of the errors hash' do
@@ -399,7 +399,7 @@ def human_attribute_name(attr, options = {})
399399 person = Person . new
400400 person . validate!
401401 person . errors . as_json ( full_messages : true )
402- end . to eq ( 'name' => [ 'name cannot be nil' ] )
402+ end . to eq ( 'name' => [ 'Name cannot be nil' ] )
403403 end
404404
405405 it 'generate_message works without i18n_scope' , skip : true do
0 commit comments