Rename profile page in registrar area to account

This commit is contained in:
Artur Beljajev 2019-05-15 13:44:36 +03:00
parent 5e0eca22cf
commit 207c2a704c
10 changed files with 10 additions and 10 deletions

View file

@ -1,5 +1,5 @@
class Registrar class Registrar
class ProfileController < BaseController class AccountController < BaseController
skip_authorization_check skip_authorization_check
helper_method :linked_users helper_method :linked_users

View file

@ -182,7 +182,7 @@ class Registrar
if can?(:show, :poll) if can?(:show, :poll)
registrar_root_path registrar_root_path
else else
registrar_profile_path registrar_account_path
end end
end end

View file

@ -24,7 +24,7 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<%= link_to can?(:show, :poll) ? registrar_root_path : registrar_profile_path, <%= link_to can?(:show, :poll) ? registrar_root_path : registrar_account_path,
class: 'navbar-brand' do %> class: 'navbar-brand' do %>
<%= t(:registrar_head_title) %> <%= t(:registrar_head_title) %>
<% if unstable_env.present? %> <% if unstable_env.present? %>

View file

@ -1,4 +1,4 @@
<% current_user_presenter = UserPresenter.new(user: current_registrar_user, view: self) %> <% current_user_presenter = UserPresenter.new(user: current_registrar_user, view: self) %>
<%= link_to current_user_presenter.login_with_role, registrar_profile_path, class: 'navbar-link' %> <%= link_to current_user_presenter.login_with_role, registrar_account_path, class: 'navbar-link' %>
<span class="text-muted">|</span> <span class="text-muted">|</span>
<%= link_to t('.sign_out'), destroy_registrar_user_session_path, method: :delete, class: 'navbar-link' %> <%= link_to t('.sign_out'), destroy_registrar_user_session_path, method: :delete, class: 'navbar-link' %>

View file

@ -1,8 +1,8 @@
en: en:
registrar: registrar:
profile: account:
show: show:
header: My profile header: Your account
linked_users: linked_users:
header: Linked users header: Linked users

View file

@ -66,7 +66,7 @@ Rails.application.routes.draw do
resources :account_activities resources :account_activities
put 'current_user/switch/:new_user_id', to: 'current_user#switch', as: :switch_current_user put 'current_user/switch/:new_user_id', to: 'current_user#switch', as: :switch_current_user
resource :profile, controller: :profile, only: :show resource :account, controller: :account, only: :show
resources :domains do resources :domains do
collection do collection do

View file

@ -10,7 +10,7 @@ RSpec.feature 'Registrar area linked users', settings: false do
end end
scenario 'switches current user to a linked one' do scenario 'switches current user to a linked one' do
visit registrar_profile_path visit registrar_account_path
click_link_or_button 'switch-current-user-2-btn' click_link_or_button 'switch-current-user-2-btn'
expect(page).to have_text('You are now signed in as a user "new-user-name"') expect(page).to have_text('You are now signed in as a user "new-user-name"')
end end

View file

@ -17,10 +17,10 @@ class RegistrarAreaPasswordSignInTest < ApplicationSystemTestCase
assert_current_path registrar_root_path assert_current_path registrar_root_path
end end
def test_after_successful_sign_in_billing_user_sees_profile def test_after_successful_sign_in_billing_user_sees_account
@user.update!(roles: [ApiUser::BILLING]) @user.update!(roles: [ApiUser::BILLING])
login_with_correct_credentials login_with_correct_credentials
assert_current_path registrar_profile_path assert_current_path registrar_account_path
end end
def test_wrong_password def test_wrong_password