Skip to content
This repository
Browse code

Rename i18n keys for password email

* Take off _paragraph prefix because text does not contian <p> tags
* Change password text copy to be more clear.
* Sort i18n keys alphabetically.
* Resolves #248
  • Loading branch information...
commit 68d77d1b6bee52d17c4df005ea7722255b1e7bb0 1 parent 5cde76b
Greg Lazarev authored croaky committed
4  app/views/clearance_mailer/change_password.html.erb
... ...
@@ -1,5 +1,5 @@
1  
-<%= t('.introduction_paragraph') %>
  1
+<%= t('.opening') %>
2 2
 
3 3
 <%= edit_user_password_url(@user, :token => @user.confirmation_token.html_safe) %>
4 4
 
5  
-<%= t('.ending_paragraph') %>
  5
+<%= t('.closing') %>
32  config/locales/clearance.en.yml
... ...
@@ -1,4 +1,12 @@
1 1
 en:
  2
+  clearance_mailer:
  3
+    change_password:
  4
+      opening:
  5
+        'Someone, hopefully you, requested we send you a link to change your
  6
+         password:'
  7
+      closing:
  8
+        "If you didn't request this, ignore this email. Your password has not
  9
+         been changed."
2 10
   flashes:
3 11
     failure_when_forbidden:
4 12
       'Please double check the URL or try submitting the form again.'
@@ -40,33 +48,25 @@ en:
40 48
         'You will receive an email within the next few minutes.
41 49
          It contains instructions for changing your password.'
42 50
     edit:
43  
-      title:
44  
-        'Change your password'
45 51
       description:
46 52
         'Your password has been reset. Choose a new password below.'
47  
-    new:
48 53
       title:
49  
-        'Reset your password'
  54
+        'Change your password'
  55
+    new:
50 56
       description:
51 57
         'To be emailed a link to reset your password, please enter your email
52 58
          address.'
  59
+      title:
  60
+        'Reset your password'
53 61
   sessions:
54 62
     new:
55  
-      title:
56  
-        'Sign in'
57  
-      sign_up:
58  
-        'Sign up'
59 63
       forgot_password:
60 64
         'Forgot password?'
  65
+      sign_up:
  66
+        'Sign up'
  67
+      title:
  68
+        'Sign in'
61 69
   users:
62 70
     new:
63 71
       sign_in:
64 72
         'Sign in'
65  
-  clearance_mailer:
66  
-    change_password:
67  
-      beginning_paragraph:
68  
-        'Someone, hopefully you, requested we send you a link to change your
69  
-         password:'
70  
-      ending_paragraph:
71  
-        "If you didn't request this, ignore this email. Your password hasn't
72  
-         been changed."
10  spec/mailers/clearance_mailer_spec.rb
@@ -21,7 +21,15 @@
21 21
     @email.body.to_s.should =~ regexp
22 22
   end
23 23
 
24  
-  it 'should set its subject' do
  24
+  it 'sets its subject' do
25 25
     @email.subject.should =~ /Change your password/
26 26
   end
  27
+
  28
+  it 'contains opening text in the body' do
  29
+    @email.body.should =~ /a link to change your password/
  30
+  end
  31
+
  32
+  it 'contains closing text in the body' do
  33
+    @email.body.should =~ /Your password has not been changed/
  34
+  end
27 35
 end

0 notes on commit 68d77d1

Please sign in to comment.
Something went wrong with that request. Please try again.