Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
079372fa
Verified
Commit
079372fa
authored
May 02, 2018
by
Markus Koller
🦊
Browse files
Rename profile link in navigation
parent
2e50ddad
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/helpers/application_helper.rb
View file @
079372fa
...
...
@@ -87,10 +87,10 @@ module ApplicationHelper
end
def
profile_link
(
user
)
if
user
.
profile
edit_profile_path
(
user
.
profile
)
elsif
user
.
volunteer?
if
user
.
volunteer?
edit_volunteer_path
(
user
.
volunteer
)
elsif
user
.
profile
edit_profile_path
(
user
.
profile
)
else
edit_user_path
(
user
)
end
...
...
app/views/application/_navigation.html.slim
View file @
079372fa
...
...
@@ -38,15 +38,13 @@ nav.navbar.navbar-top.hidden-print
span
=
"
#{
current_user
.
full_name
}
#{
t
(
"role.
#{
current_user
.
role
}
"
)
}
"
span
.caret
ul
.dropdown-menu
-
if
current_user
.
volunteer?
li
=
link_to
'Profil anzeigen'
,
edit_volunteer_path
(
current_user
.
volunteer
.
id
)
-
else
li
-
if
current_user
.
profile
.
blank?
=
link_to
'Profil erfassen'
,
new_profile_path
-
else
=
link_to
'Profil anzeigen'
,
current_user
.
profile
li
-
if
current_user
.
volunteer?
=
link_to
'Profil bearbeiten'
,
profile_link
(
current_user
)
-
elsif
current_user
.
profile
.
blank?
=
link_to
'Profil erfassen'
,
new_profile_path
-
else
=
link_to
'Profil bearbeiten'
,
edit_profile_path
(
current_user
.
profile
)
-
if
policy
(
current_user
).
edit?
li
=
link_to
'Login bearbeiten'
,
edit_user_path
(
current_user
)
...
...
test/system/feedbacks_test.rb
View file @
079372fa
...
...
@@ -32,7 +32,7 @@ class FeedbacksTest < ApplicationSystemTestCase
within
'.navbar-top'
do
click_link
I18n
.
t
(
"role.
#{
@user_volunteer
.
role
}
"
),
href:
'#'
end
click_link
'Profil
anz
ei
g
en'
click_link
'Profil
bearb
ei
t
en'
within
'.assignments-table'
do
click_link
'Feedback Liste'
,
href:
polymorphic_path
([
@volunteer
,
@assignment
,
Feedback
])
end
...
...
@@ -47,7 +47,7 @@ class FeedbacksTest < ApplicationSystemTestCase
within
'.navbar-top'
do
click_link
I18n
.
t
(
"role.
#{
@user_volunteer
.
role
}
"
),
href:
'#'
end
click_link
'Profil
anz
ei
g
en'
click_link
'Profil
bearb
ei
t
en'
within
'.group-assignments-table'
do
click_link
'Feedback Liste'
,
href:
polymorphic_path
([
@volunteer
,
@group_offer
,
Feedback
])
end
...
...
test/system/hours_test.rb
View file @
079372fa
...
...
@@ -15,11 +15,6 @@ class HoursTest < ApplicationSystemTestCase
create
:group_assignment
,
group_offer:
@group_offer1
,
volunteer:
@volunteer1
,
period_start:
7
.
weeks
.
ago
login_as
@user_volunteer1
visit
root_url
within
'.navbar-top'
do
click_link
I18n
.
t
(
"role.
#{
@user_volunteer1
.
role
}
"
),
href:
'#'
end
click_link
'Profil anzeigen'
end
test
'volunteer can create hour report for an assignment'
do
...
...
test/system/profiles_test.rb
View file @
079372fa
...
...
@@ -68,30 +68,12 @@ class ProfilesTest < ApplicationSystemTestCase
within
'.navbar-top'
do
click_link
I18n
.
t
(
"role.
#{
@user_without_profile
.
role
}
"
),
href:
'#'
end
click_link
'Profil anzeigen'
click_link
'Profil bearbeiten'
,
match: :first
click_link
'Zurück'
assert
page
.
has_text?
@user_without_profile
.
profile
.
contact
.
first_name
assert
page
.
has_text?
@user_without_profile
.
profile
.
contact
.
last_name
end
test
'user can change the password from profile page'
do
login_as
@user
visit
profile_path
(
@user
.
profile
.
id
)
click_link
'Login bearbeiten'
assert
page
.
has_field?
'Passwort'
assert
page
.
has_field?
'Email'
assert
page
.
has_field?
'Rolle'
fill_in
'Passwort'
,
with:
'abcdefghijk'
fill_in
'Email'
,
with:
'new@email.com'
click_button
'Login aktualisieren'
user
=
User
.
find
@user
.
id
assert
user
.
valid_password?
'abcdefghijk'
assert_equal
user
.
email
,
'new@email.com'
end
test
'profileless user gets new profile link on show profile'
do
login_as
@user_without_profile
visit
user_path
(
@user_without_profile
)
...
...
test/system/trial_feedbacks_test.rb
View file @
079372fa
...
...
@@ -33,7 +33,7 @@ class TrialFeedbacksTest < ApplicationSystemTestCase
within
'.navbar-top'
do
click_link
I18n
.
t
(
"role.
#{
@user_volunteer
.
role
}
"
),
href:
'#'
end
click_link
'Profil
anz
ei
g
en'
click_link
'Profil
bearb
ei
t
en'
within
'.assignments-table'
do
click_link
'Probezeit Feedback Liste'
end
...
...
@@ -48,7 +48,7 @@ class TrialFeedbacksTest < ApplicationSystemTestCase
within
'.navbar-top'
do
click_link
I18n
.
t
(
"role.
#{
@user_volunteer
.
role
}
"
),
href:
'#'
end
click_link
'Profil
anz
ei
g
en'
click_link
'Profil
bearb
ei
t
en'
within
'.group-assignments-table'
do
click_link
'Probezeit Feedback Liste'
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment