mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Adding test to cover the broken placeholder code
This test will expose the situation where i18n.t() is run twice on the placeholder - resulting in :placeholder => "raw" becoming placeholder="Raw" for many users.
This commit is contained in:
parent
c679153ee9
commit
8f992f1185
1 changed files with 7 additions and 0 deletions
|
@ -12,6 +12,13 @@ class TextInputTest < ActionView::TestCase
|
|||
assert_select 'textarea.text[placeholder="Put in some text"]'
|
||||
end
|
||||
|
||||
test 'input generates a placeholder from the translations' do
|
||||
store_translations(:en, simple_form: { placeholders: { user: { name: "placeholder from i18n en.simple_form.placeholders.user.name" } } }) do
|
||||
with_input_for @user, :name, :text
|
||||
assert_select 'textarea.text[placeholder="placeholder from i18n en.simple_form.placeholders.user.name"]'
|
||||
end
|
||||
end
|
||||
|
||||
test 'input gets maxlength from column definition for text attributes' do
|
||||
with_input_for @user, :description, :text
|
||||
assert_select 'textarea.text[maxlength="200"]'
|
||||
|
|
Loading…
Reference in a new issue