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
67666a3c
Commit
67666a3c
authored
Feb 06, 2017
by
Jose Ivan Vargas
Committed by
Timothy Andrew
Feb 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added and fixed tests on the admin_users_spec.rb
parent
c1870909
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
app/models/user.rb
app/models/user.rb
+4
-0
app/views/admin/users/_form.html.haml
app/views/admin/users/_form.html.haml
+1
-1
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+15
-1
No files found.
app/models/user.rb
View file @
67666a3c
...
...
@@ -533,6 +533,10 @@ class User < ActiveRecord::Base
admin
end
def
is_auditor?
auditor
end
def
require_ssh_key?
keys
.
count
==
0
&&
Gitlab
::
ProtocolAccess
.
allowed?
(
'ssh'
)
end
...
...
app/views/admin/users/_form.html.haml
View file @
67666a3c
...
...
@@ -70,7 +70,7 @@
Admin
%p
.light
You cannot remove your own admin rights
-
else
-
else
=
f
.
radio_button
:access_level
,
:admin
=
label_tag
:admin
do
Admin
...
...
spec/features/admin/admin_users_spec.rb
View file @
67666a3c
...
...
@@ -211,7 +211,7 @@ describe "Admin::Users", feature: true do
fill_in
"user_email"
,
with:
"bigbang@mail.com"
fill_in
"user_password"
,
with:
"AValidPassword1"
fill_in
"user_password_confirmation"
,
with:
"AValidPassword1"
ch
eck
"user
_admin"
ch
oose
"user_access_level
_admin"
click_button
"Save changes"
end
...
...
@@ -228,6 +228,20 @@ describe "Admin::Users", feature: true do
end
end
describe
"Update user account type"
do
before
do
allow_any_instance_of
(
AuditorUserHelper
).
to
receive
(
:license_allows_auditor_user?
).
and_return
(
true
)
choose
"user_access_level_auditor"
click_button
"Save changes"
end
it
"changes account type to be auditor"
do
user
.
reload
expect
(
user
.
is_admin?
).
to
be_falsey
expect
(
user
.
is_auditor?
).
to
be_truthy
end
end
describe
'update username to non ascii char'
do
it
do
fill_in
'user_username'
,
with:
'\u3042\u3044'
...
...
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