diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 1f6bbf6b..7d701c6c 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -6,6 +6,10 @@
<%= f.label :email %>
<%= f.email_field :email, :autofocus => true %>
+ <% if resource.class.reconfirmable && resource.unconfirmed_email.present? %> +
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
+ <% end %> +
<%= f.label :password %> (leave blank if you don't want to change it)
<%= f.password_field :password, :autocomplete => "off" %>
diff --git a/lib/generators/templates/simple_form_for/registrations/edit.html.erb b/lib/generators/templates/simple_form_for/registrations/edit.html.erb index 6a9a4b39..52f8fa82 100644 --- a/lib/generators/templates/simple_form_for/registrations/edit.html.erb +++ b/lib/generators/templates/simple_form_for/registrations/edit.html.erb @@ -5,6 +5,11 @@
<%= f.input :email, :required => true, :autofocus => true %> + + <% if resource.class.reconfirmable && resource.unconfirmed_email.present? %> +

Currently waiting confirmation for: <%= resource.unconfirmed_email %>

+ <% end %> + <%= f.input :password, :autocomplete => "off", :hint => "leave it blank if you don't want to change it", :required => false %> <%= f.input :password_confirmation, :required => false %> <%= f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true %> diff --git a/test/integration/confirmable_test.rb b/test/integration/confirmable_test.rb index 9acd99ea..c9858572 100644 --- a/test/integration/confirmable_test.rb +++ b/test/integration/confirmable_test.rb @@ -268,6 +268,7 @@ class ConfirmationOnChangeTest < ActionController::IntegrationTest admin = create_admin admin.update_attributes(:email => 'first_test@example.com') assert_equal 'first_test@example.com', admin.unconfirmed_email + confirmation_token = admin.confirmation_token admin.update_attributes(:email => 'second_test@example.com') assert_equal 'second_test@example.com', admin.unconfirmed_email diff --git a/test/integration/registerable_test.rb b/test/integration/registerable_test.rb index fb3f31f8..5fc487ea 100644 --- a/test/integration/registerable_test.rb +++ b/test/integration/registerable_test.rb @@ -303,8 +303,10 @@ class ReconfirmableRegistrationTest < ActionController::IntegrationTest assert_current_url '/admin_area/home' assert_contain 'but we need to verify your new email address' + assert_equal 'admin.new@example.com', Admin.first.unconfirmed_email - assert_equal "admin.new@example.com", Admin.first.unconfirmed_email + get edit_admin_registration_path + assert_contain 'Currently waiting confirmation for: admin.new@example.com' end test 'a signed in admin should not see a reconfirmation message if they did not change their password' do