Display username instead of email
This commit is contained in:
parent
01effc198c
commit
010a8fd593
2 changed files with 9 additions and 8 deletions
|
@ -17,7 +17,7 @@
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<ul class="navbar-nav ml-auto">
|
<ul class="navbar-nav ml-auto">
|
||||||
<li class="nav-item dropdown">
|
<li class="nav-item dropdown">
|
||||||
<%= link_to truncate(current_user.email),
|
<%= link_to current_user.account.username,
|
||||||
'#',
|
'#',
|
||||||
id: :navbarDropdown,
|
id: :navbarDropdown,
|
||||||
role: :button,
|
role: :button,
|
||||||
|
|
|
@ -21,7 +21,7 @@ Given 'I am signed in with email {string}' do |email|
|
||||||
click_on 'Войти'
|
click_on 'Войти'
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_css 'ul > li > a', text: @user.email
|
expect(page).to have_css 'ul > li > a', text: @user.account.username
|
||||||
end
|
end
|
||||||
|
|
||||||
Given 'I am signed in with email {string} ' \
|
Given 'I am signed in with email {string} ' \
|
||||||
|
@ -37,7 +37,7 @@ Given 'I am signed in with email {string} ' \
|
||||||
click_on 'Войти'
|
click_on 'Войти'
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_css 'ul > li > a', text: @user.email
|
expect(page).to have_css 'ul > li > a', text: @user.account.username
|
||||||
end
|
end
|
||||||
|
|
||||||
Given 'I am signed in as party supporter' do
|
Given 'I am signed in as party supporter' do
|
||||||
|
@ -55,7 +55,7 @@ Given 'I am signed in as party supporter' do
|
||||||
click_on 'Войти'
|
click_on 'Войти'
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_css 'ul > li > a', text: @user.email
|
expect(page).to have_css 'ul > li > a', text: @user.account.username
|
||||||
end
|
end
|
||||||
|
|
||||||
Given 'I am signed in as party member' do
|
Given 'I am signed in as party member' do
|
||||||
|
@ -73,7 +73,7 @@ Given 'I am signed in as party member' do
|
||||||
click_on 'Войти'
|
click_on 'Войти'
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_css 'ul > li > a', text: @user.email
|
expect(page).to have_css 'ul > li > a', text: @user.account.username
|
||||||
end
|
end
|
||||||
|
|
||||||
Given 'I am signed in as excluded party member' do
|
Given 'I am signed in as excluded party member' do
|
||||||
|
@ -91,7 +91,7 @@ Given 'I am signed in as excluded party member' do
|
||||||
click_on 'Войти'
|
click_on 'Войти'
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_css 'ul > li > a', text: @user.email
|
expect(page).to have_css 'ul > li > a', text: @user.account.username
|
||||||
end
|
end
|
||||||
|
|
||||||
When 'I try to sign in with email {string} ' \
|
When 'I try to sign in with email {string} ' \
|
||||||
|
@ -107,7 +107,7 @@ When 'I try to sign in with email {string} ' \
|
||||||
end
|
end
|
||||||
|
|
||||||
When 'I try to sign out' do
|
When 'I try to sign out' do
|
||||||
click_on @user.email
|
click_on @user.account.username
|
||||||
click_on 'Выйти'
|
click_on 'Выйти'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -117,7 +117,8 @@ When 'I follow confirmation link for email {string}' do |email|
|
||||||
end
|
end
|
||||||
|
|
||||||
Then 'I am signed in as {string}' do |email|
|
Then 'I am signed in as {string}' do |email|
|
||||||
expect(page).to have_css 'ul > li > a', text: email
|
user = User.find_by! email: email
|
||||||
|
expect(page).to have_css 'ul > li > a', text: user.account.username
|
||||||
end
|
end
|
||||||
|
|
||||||
Then 'I fail to sign in' do
|
Then 'I fail to sign in' do
|
||||||
|
|
Reference in a new issue