From bfe231490187d4d0826c53e4b719bcf8f55db2dc Mon Sep 17 00:00:00 2001 From: Marcelo Cajueiro Date: Mon, 21 Nov 2011 20:54:45 -0200 Subject: [PATCH] Add test case to hint (i18n): a model should not be used as attribute in a hint; --- test/form_builder/hint_test.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/form_builder/hint_test.rb b/test/form_builder/hint_test.rb index 299a6c67..0d95f168 100644 --- a/test/form_builder/hint_test.rb +++ b/test/form_builder/hint_test.rb @@ -79,6 +79,15 @@ class HintTest < ActionView::TestCase end end + test 'hint should not use i18n just with attribute to lookup translation if it is a model' do + store_translations(:en, :simple_form => { :hints => { + :company => { :name => 'Nome' } + } } ) do + with_hint_for @user, :company, :reflection => Association.new(Company, :company, {}) + assert_no_select 'span.hint' + end + end + test 'hint should use i18n just with attribute to lookup translation' do store_translations(:en, :simple_form => { :hints => { :name => 'Content of this input will be downcased...' @@ -112,4 +121,4 @@ class HintTest < ActionView::TestCase assert_select 'span.omg_hint', "can't be blank" end end -end \ No newline at end of file +end