Commit 5577b046

mo <mokha@cisco.com>
2017-09-02 22:30:47
add translation and fix spec.
1 parent 5f85128
Changed files (3)
app
views
config
locales
controllers
my
shared
spec
app/views/my/shared/_my_nav.html.erb
@@ -12,7 +12,7 @@
   <%= link_to "My Profile", my_root_path(anchor: 'profile/me'), class: "nav-link" %>
   <%= link_to "My Favorites", my_favorites_path, class: "nav-link #{"active" if controller?(:favorites)}" %>
   <%= link_to "My Photo", new_my_avatar_path, class: "nav-link #{"active" if controller?(:avatars)}" %>
-  <%= link_to "Change My Password", my_passwords_path, class: "nav-link #{"active" if controller?(:passwords)}" %>
+  <%= link_to t('.change_password'), my_passwords_path, class: "nav-link #{"active" if controller?(:passwords)}" %>
 
   <% if current_user.admin? %>
     <h5>Admin</h5>
config/locales/controllers/my/shared/en.yml
@@ -0,0 +1,6 @@
+---
+en:
+  my:
+    shared:
+      my_nav:
+        change_password: "Change My Password"
spec/features/change_password_spec.rb
@@ -8,7 +8,8 @@ describe "changing my password", js: true do
 
     it "displays a confirmation message" do
       visit my_dashboard_path
-      click_link("Account")
+      click_link(I18n.t("my.shared.my_nav.change_password"))
+
       within(".form-horizontal") do
         fill_in("user_password", with: "secret")
         fill_in("user_password_confirmation", with: "secret")