On Wed, Mar 30, 2011 at 4:29 PM, Aaron Patterson <[email protected]
> wrote:
> + def
> test_translated_model_attributes_with_attribute_matching_namespaced_model_name_and_dot
> + assert_deprecated do
> + I18n.backend.store_translations 'en', :activemodel => {:attributes
> => {:person => {:gender => 'person gender'}, :"person.gender" => {:attribute
> => 'person gender attribute'}}}
> + end
> +
> + assert_equal 'person gender', Person.human_attribute_name('gender')
> + assert_equal 'person gender attribute',
> Person::Gender.human_attribute_name('attribute')
> + end
> +
>
No, it's in spirit something more like:
def test_deprecated_namespaced_model_attribute_translation
assert_deprecated do
I18n.backend.store_translations 'en', :activemodel => {:attributes =>
{:person => {:gender => {:attribute => 'person gender attribute'}}}}
end
assert_equal 'person gender
attribute', Person::Gender.human_attribute_name('attribute')
end
I'm not sure how to make the assert_deprecated part of that pass though...
BTW, have a great vacation! :-)
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.