Permalink
Browse files

fixing unit tests for active_record validations_i18n

  • Loading branch information...
1 parent e3ecc33 commit d0ee883e7c01dabf039525b80b7f43673e987265 Sven Fuchs committed Aug 13, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/test/cases/validations_i18n_test.rb
@@ -46,14 +46,14 @@ def test_errors_generate_message_translates_custom_model_attribute_key
global_scope = [:active_record, :error_messages]
custom_scope = global_scope + [:custom, 'topic', :title]
- I18n.expects(:t).with nil, :scope => [:active_record, :error_messages], :default => [:"custom.topic.title.invalid", 'default from class def', :invalid]
+ I18n.expects(:t).with :"custom.topic.title.invalid", :scope => [:active_record, :error_messages], :default => ['default from class def', :invalid]
@topic.errors.generate_message :title, :invalid, :default => 'default from class def'
end
def test_errors_generate_message_translates_custom_model_attribute_keys_with_sti
custom_scope = [:active_record, :error_messages, :custom, 'topic', :title]
- I18n.expects(:t).with nil, :scope => [:active_record, :error_messages], :default => [:"custom.reply.title.invalid", :"custom.topic.title.invalid", 'default from class def', :invalid]
+ I18n.expects(:t).with :"custom.reply.title.invalid", :scope => [:active_record, :error_messages], :default => [:"custom.topic.title.invalid", 'default from class def', :invalid]
Reply.new.errors.generate_message :title, :invalid, :default => 'default from class def'
end

0 comments on commit d0ee883

Please sign in to comment.