Improve readability

This commit is contained in:
Artur Beljajev 2018-07-16 01:31:36 +03:00
parent f1cbdec8e7
commit 989bb32548
8 changed files with 8 additions and 8 deletions

View file

@ -14,7 +14,7 @@ module Admin
end end
def user_for_paper_trail def user_for_paper_trail
current_admin_user ? current_admin_user.id_role_username : 'guest' current_admin_user ? current_admin_user.id_role_username : 'anonymous'
end end
end end
end end

View file

@ -33,7 +33,7 @@ module Admin
end end
def user_for_paper_trail def user_for_paper_trail
current_admin_user ? current_admin_user.id_role_username : 'guest' current_admin_user ? current_admin_user.id_role_username : 'anonymous'
end end
end end
end end

View file

@ -107,6 +107,6 @@ class Registrant::SessionsController < Devise::SessionsController
end end
def user_for_paper_trail def user_for_paper_trail
current_registrant_user.present? ? current_registrant_user.id_role_username : 'guest' current_registrant_user.present? ? current_registrant_user.id_role_username : 'anonymous'
end end
end end

View file

@ -17,6 +17,6 @@ class RegistrantController < ApplicationController
end end
def user_for_paper_trail def user_for_paper_trail
current_registrant_user.present? ? current_registrant_user.id_role_username : 'guest' current_registrant_user.present? ? current_registrant_user.id_role_username : 'anonymous'
end end
end end

View file

@ -36,7 +36,7 @@ class Registrar
end end
def user_for_paper_trail def user_for_paper_trail
current_registrar_user ? current_registrar_user.id_role_username : 'guest' current_registrar_user ? current_registrar_user.id_role_username : 'anonymous'
end end
end end
end end

View file

@ -180,7 +180,7 @@ class Registrar
end end
def user_for_paper_trail def user_for_paper_trail
current_registrar_user ? current_registrar_user.id_role_username : 'guest' current_registrar_user ? current_registrar_user.id_role_username : 'anonymous'
end end
end end
end end

View file

@ -1,7 +1,7 @@
require 'test_helper' require 'test_helper'
class AdminAreaProtectedAreaTest < ActionDispatch::IntegrationTest class AdminAreaProtectedAreaTest < ActionDispatch::IntegrationTest
def test_unauthenticated_user_is_asked_to_authenticate_when_navigating_to_protected_area def test_anonymous_user_is_asked_to_authenticate_when_navigating_to_protected_area
visit admin_domains_url visit admin_domains_url
assert_text 'You need to sign in before continuing' assert_text 'You need to sign in before continuing'
assert_current_path new_admin_user_session_path assert_current_path new_admin_user_session_path

View file

@ -1,7 +1,7 @@
require 'test_helper' require 'test_helper'
class RegistrarAreaProtectedAreaTest < ActionDispatch::IntegrationTest class RegistrarAreaProtectedAreaTest < ActionDispatch::IntegrationTest
def test_unauthenticated_user_is_asked_to_authenticate_when_navigating_to_protected_area def test_anonymous_user_is_asked_to_authenticate_when_navigating_to_protected_area
visit registrar_domains_url visit registrar_domains_url
assert_text 'You need to sign in before continuing' assert_text 'You need to sign in before continuing'
assert_current_path new_registrar_user_session_path assert_current_path new_registrar_user_session_path