diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-28 05:01:57 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-28 05:23:34 -0300 |
commit | 1851af84c1c7244dc416be9c93a4700b70e801e3 (patch) | |
tree | 70c7304b1bf1fb0ed9c8f3425c23ea432b0a64f8 /actionpack/test | |
parent | d630c76f3fef54da4859d540060e90cc294b5516 (diff) | |
download | rails-1851af84c1c7244dc416be9c93a4700b70e801e3.tar.gz rails-1851af84c1c7244dc416be9c93a4700b70e801e3.tar.bz2 rails-1851af84c1c7244dc416be9c93a4700b70e801e3.zip |
password_field renders with nil value by default
This makes the use of passwords secure by default if you want to render
the value of the password_field you have to do for instance
f.password_field(:password, :value => @user.password) # =>
<input type=password id=user_password name=user[password]
value=#{@user.password} />
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 8ba4aa1639..fd801e2a9e 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -167,7 +167,10 @@ class FormHelperTest < ActionView::TestCase '<input id="post_title" name="post[title]" size="30" type="text" value="Hello World" />', text_field("post", "title") ) assert_dom_equal( - '<input id="post_title" name="post[title]" size="30" type="password" value="Hello World" />', password_field("post", "title") + '<input id="post_title" name="post[title]" size="30" type="password" />', password_field("post", "title") + ) + assert_dom_equal( + '<input id="post_title" name="post[title]" size="30" type="password" value="Hello World" />', password_field("post", "title", :value => @post.title) ) assert_dom_equal( '<input id="person_name" name="person[name]" size="30" type="password" />', password_field("person", "name") |