summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-02-01 21:33:13 -0700
committermo khan <mo@mokhan.ca>2015-02-01 21:33:13 -0700
commit74fbea95e4f4a27e3e4fdc2b4e897b0316bd56f2 (patch)
tree085c60e575c148ad03791023d90bc37a3f10c2a8
parente5bd627538b428fe94f16ee430b4cdad085f10f2 (diff)
move translation out of devise.en.yml to en.yml
-rw-r--r--app/controllers/passwords_controller.rb2
-rw-r--r--config/locales/en.yml1
-rw-r--r--spec/features/forgot_password_spec.rb5
-rw-r--r--spec/support/pages/dashboard_page.rb2
4 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb
index 8ddeae60..7b461776 100644
--- a/app/controllers/passwords_controller.rb
+++ b/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
diff --git a/config/locales/en.yml b/config/locales/en.yml
index cd7e6322..02ddf0d6 100644
--- a/config/locales/en.yml
+++ b/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.'
diff --git a/spec/features/forgot_password_spec.rb b/spec/features/forgot_password_spec.rb
index f394b1e9..a89b196f 100644
--- a/spec/features/forgot_password_spec.rb
+++ b/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
diff --git a/spec/support/pages/dashboard_page.rb b/spec/support/pages/dashboard_page.rb
index bd7e9dbe..3fb2992e 100644
--- a/spec/support/pages/dashboard_page.rb
+++ b/spec/support/pages/dashboard_page.rb
@@ -1,3 +1,5 @@
+require_relative "../web_page.rb"
+
class DashboardPage < WebPage
def initialize
super(my_dashboard_path)