diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-07 17:55:54 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-07 17:55:54 +0000 |
commit | 6adf61fd02e519e8dce7b3e8d50042c38a1a0acf (patch) | |
tree | 2d0e73a56d6e2d11b22d88cf7c4f89843bf949e2 | |
parent | 986ffb24343877a76b505363aa2dc836e16465f5 (diff) | |
download | redmine-6adf61fd02e519e8dce7b3e8d50042c38a1a0acf.tar.gz redmine-6adf61fd02e519e8dce7b3e8d50042c38a1a0acf.zip |
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9941 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/views/account/password_recovery.html.erb | 23 | ||||
-rw-r--r-- | test/integration/account_test.rb | 4 |
2 files changed, 18 insertions, 9 deletions
diff --git a/app/views/account/password_recovery.html.erb b/app/views/account/password_recovery.html.erb index 53c635050..24da8223b 100644 --- a/app/views/account/password_recovery.html.erb +++ b/app/views/account/password_recovery.html.erb @@ -2,14 +2,19 @@ <%= error_messages_for 'user' %> -<%= form_tag({:token => @token.value}) do %> -<div class="box tabular"> -<p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> -<%= password_field_tag 'new_password', nil, :size => 25 %> -<em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p> +<%= form_tag(lost_password_path) do %> + <%= hidden_field_tag 'token', @token.value %> + <div class="box tabular"> + <p> + <label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> + <%= password_field_tag 'new_password', nil, :size => 25 %> + <em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em> + </p> -<p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> -<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p> -</div> -<p><%= submit_tag l(:button_save) %></p> + <p> + <label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> + <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %> + </p> + </div> + <p><%= submit_tag l(:button_save) %></p> <% end %> diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb index 9f73be2c2..d50bb894e 100644 --- a/test/integration/account_test.rb +++ b/test/integration/account_test.rb @@ -76,6 +76,7 @@ class AccountTest < ActionController::IntegrationTest get "account/lost_password" assert_response :success assert_template "account/lost_password" + assert_select 'input[name=mail]' post "account/lost_password", :mail => 'jSmith@somenet.foo' assert_redirected_to "/login" @@ -88,6 +89,9 @@ class AccountTest < ActionController::IntegrationTest get "account/lost_password", :token => token.value assert_response :success assert_template "account/password_recovery" + assert_select 'input[type=hidden][name=token][value=?]', token.value + assert_select 'input[name=new_password]' + assert_select 'input[name=new_password_confirmation]' post "account/lost_password", :token => token.value, :new_password => 'newpass', :new_password_confirmation => 'newpass' assert_redirected_to "/login" |