From 6e800341c359356801d529ff9cfd5a2cf5fe6c0f Mon Sep 17 00:00:00 2001 From: Victor Nava Date: Wed, 4 Mar 2015 16:00:46 +1100 Subject: [PATCH] Fixes issue #362 Change admin account link to point to account page instead of edit user. --- app/views/spree/layouts/admin/_login_nav.html.haml | 2 +- spec/features/admin/authentication_spec.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/spree/layouts/admin/_login_nav.html.haml b/app/views/spree/layouts/admin/_login_nav.html.haml index 4ecb72d148..088ac02377 100644 --- a/app/views/spree/layouts/admin/_login_nav.html.haml +++ b/app/views/spree/layouts/admin/_login_nav.html.haml @@ -5,7 +5,7 @@ \: #{spree_current_user.email} %li{"data-hook" => "user-account-link"} %i.icon-user - = link_to t(:account), spree.edit_user_path(spree_current_user) + = link_to t(:account), account_path %li{"data-hook" => "user-logout-link"} %i.icon-signout = link_to t(:logout), spree.logout_path diff --git a/spec/features/admin/authentication_spec.rb b/spec/features/admin/authentication_spec.rb index beb8c31c2b..12e9795ad2 100644 --- a/spec/features/admin/authentication_spec.rb +++ b/spec/features/admin/authentication_spec.rb @@ -2,6 +2,9 @@ require 'spec_helper' feature "Authentication", js: true do include UIComponentHelper + include AuthenticationWorkflow + include WebHelper + let(:user) { create(:user, password: "password", password_confirmation: "password") } scenario "logging into admin redirects home, then back to admin" do @@ -16,4 +19,10 @@ feature "Authentication", js: true do page.should have_content "Dashboard" current_path.should == spree.admin_path end + + scenario "viewing my account" do + login_to_admin_section + click_link "Account" + current_path.should == spree.account_path + end end