Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1da22cec
Commit
1da22cec
authored
Jul 09, 2018
by
Dustin Utecht
Committed by
Douwe Maan
Jul 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show "Sign in" instead of "Sign in / Register" when sign up is disabled
parent
9a9b4444
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+3
-1
spec/features/users/show_spec.rb
spec/features/users/show_spec.rb
+24
-0
No files found.
app/views/layouts/header/_default.html.haml
View file @
1da22cec
...
@@ -61,7 +61,9 @@
...
@@ -61,7 +61,9 @@
-
if
header_link?
(
:sign_in
)
-
if
header_link?
(
:sign_in
)
%li
.nav-item
%li
.nav-item
%div
%div
=
link_to
"Sign in / Register"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'btn btn-sign-in'
-
sign_in_text
=
allow_signup?
?
'Sign in / Register'
:
'Sign in'
=
link_to
sign_in_text
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'btn btn-sign-in'
%button
.navbar-toggler.d-block.d-sm-none
{
type:
'button'
}
%button
.navbar-toggler.d-block.d-sm-none
{
type:
'button'
}
%span
.sr-only
Toggle navigation
%span
.sr-only
Toggle navigation
...
...
spec/features/users/show_spec.rb
View file @
1da22cec
...
@@ -14,4 +14,28 @@ describe 'User page' do
...
@@ -14,4 +14,28 @@ describe 'User page' do
expect
(
page
).
to
have_link
(
'Snippets'
)
expect
(
page
).
to
have_link
(
'Snippets'
)
end
end
end
end
context
'signup disabled'
do
it
'shows the sign in link'
do
stub_application_setting
(
signup_enabled:
false
)
visit
(
user_path
(
user
))
page
.
within
'.navbar-nav'
do
expect
(
page
).
to
have_link
(
'Sign in'
)
end
end
end
context
'signup enabled'
do
it
'shows the sign in and register link'
do
stub_application_setting
(
signup_enabled:
true
)
visit
(
user_path
(
user
))
page
.
within
'.navbar-nav'
do
expect
(
page
).
to
have_link
(
'Sign in / Register'
)
end
end
end
end
end
Write
Preview
Markdown
is supported
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