Made the password reset email friendlier.

Also did the same for the unlock instructions, while I was in there.
This commit is contained in:
Skud
2013-03-26 16:17:04 +11:00
parent cc987b443f
commit dcd7df7f47
6 changed files with 38 additions and 25 deletions

View File

@@ -1,8 +1,5 @@
- site_name = Growstuff::Application.config.site_name
%p
Welcome,
= @resource.login_name
!
%p Hello #{@resource.login_name},
%p
Your account on #{site_name} has been created. You just need to confirm

View File

@@ -1,12 +1,19 @@
%p
Hello
= @resource.email
!
- site_name = Growstuff::Application.config.site_name
%p Hello #{@resource.login_name},
%p Someone has requested a link to change your password, and you can do this through the link below.
%p Someone has requested a link to reset your password on #{site_name}.
We presume this was you, in which case you can do so through this link:
%p
= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
%p If you didn't request this, please ignore this email.
%p Your password won't change until you access the link above and create a new one.
%p If it wasn't you, then someone's made a typo or has been messing
around. In this case, you can safely ignore this email, and your
password will not be changed.
%p See you soon,
%p The #{site_name} team.
%br/
=link_to root_url, root_url

View File

@@ -1,13 +1,20 @@
%p
Hello
= @resource.email
!
- site_name = Growstuff::Application.config.site_name
%p Hello #{@resource.login_name},
%p
Your account has been locked due to an excessive amount of unsuccessful sign
in attempts.
Your #{site_name} account has been locked due to an excessive number
of unsuccessful sign in attempts. We do this in case someone's trying
to break into your account, but it might also mean you've just
forgotten your password. In either case, use the link below to unlock
your account:
%p Click the link below to unlock your account:
%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token)
%p
= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token)
%p If you have actually forgotten your password, you can
= link_to 'reset your password', new_password_url(@resource)
after you've unlocked your account.
%p See you soon,
%p The #{site_name} team.
%br/
=link_to root_url, root_url

View File

@@ -58,6 +58,6 @@ en:
confirmation_instructions:
subject: 'Welcome to Growstuff. Please confirm your account.'
reset_password_instructions:
subject: 'Reset password instructions'
subject: 'Growstuff password reset instructions'
unlock_instructions:
subject: 'Unlock Instructions'
subject: 'Unlock your Growstuff account'

View File

@@ -12,7 +12,7 @@ describe 'devise/mailer/reset_password_instructions.html.haml', :type => "view"
it 'should have some of the right text' do
rendered.should contain 'Change my password'
rendered.should contain 'please ignore this email'
rendered.should contain 'Someone has requested a link to reset your password'
end
end
end

View File

@@ -1,14 +1,16 @@
require 'spec_helper'
describe 'devise/mailer/unlock_instructions.html.haml', :type => "view" do
context "logged in" do
before(:each) do
@resource = mock_model(Member)
#@resource = mock_model(Member)
@resource = FactoryGirl.create(:member)
@resource.should_receive(:email).and_return("example@example.com")
@resource.should_receive(:unlock_token).and_return("fred")
render
end
it "should explain what's happened" do
rendered.should contain "Your account has been locked"
rendered.should contain "account has been locked"
end
it "should have an unlock link" do