Commit 74fbea95

mo khan <mo@mokhan.ca>
2015-02-02 04:33:13
move translation out of devise.en.yml to en.yml
1 parent e5bd627
Changed files (4)
app
config
locales
spec
app/controllers/passwords_controller.rb
@@ -5,7 +5,7 @@ class PasswordsController < ApplicationController
 
   def create
     PasswordReset.send_reset_instructions_to(params[:user][:email])
-    redirect_to new_session_path, notice: t('devise.passwords.send_instructions')
+    redirect_to new_session_path, notice: t('passwords.send_instructions')
   end
 
   def edit
config/locales/en.yml
@@ -25,6 +25,7 @@ en:
   passwords_do_not_match: 'The passwords should match and should be a minimum of 6 characters.'
   tutorial_saved: 'Your tutorial was added.'
   passwords:
+    send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
     updated: 'Your password was updated.'
   profile_saved: 'Your settings have been updated successfully!'
   avatar_uploaded: 'Your avatar has been updated.'
spec/features/forgot_password_spec.rb
@@ -3,6 +3,7 @@ require "rails_helper"
 describe "password retrieval", :js => true do
   context "when a user attempts to retrieve their password" do
     let(:user) { create(:user) }
+    let(:error_message) { I18n.t('passwords.send_instructions') }
 
     before :each do
       visit login_path
@@ -13,8 +14,8 @@ describe "password retrieval", :js => true do
       click_button "Send me reset password instructions"
     end
 
-    it "should send them an email with instructions" do
-      expect(page).to have_content(I18n.t('devise.passwords.send_instructions'))
+    it "sends them an email with instructions" do
+      expect(page).to have_content(error_message)
     end
   end
 
spec/support/pages/dashboard_page.rb
@@ -1,3 +1,5 @@
+require_relative "../web_page.rb"
+
 class DashboardPage < WebPage
   def initialize
     super(my_dashboard_path)