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
3b3aeb04
Commit
3b3aeb04
authored
May 24, 2019
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE-specific code from admin users spec
parent
39fd1cbe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
62 deletions
+86
-62
ee/spec/features/admin/admin_users_spec.rb
ee/spec/features/admin/admin_users_spec.rb
+86
-0
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+0
-62
No files found.
ee/spec/features/admin/admin_users_spec.rb
0 → 100644
View file @
3b3aeb04
require
'spec_helper'
describe
"Admin::Users"
do
include
Spec
::
Support
::
Helpers
::
Features
::
ResponsiveTableHelpers
let!
(
:user
)
do
create
(
:omniauth_user
,
provider:
'twitter'
,
extern_uid:
'123456'
)
end
let!
(
:current_user
)
{
create
(
:admin
,
last_activity_on:
5
.
days
.
ago
)
}
before
do
sign_in
(
current_user
)
end
describe
"GET /admin/users/:id"
do
describe
'Shared runners quota status'
do
before
do
user
.
namespace
.
update
(
shared_runners_minutes_limit:
500
)
end
context
'with projects with shared runners enabled'
do
before
do
create
(
:project
,
namespace:
user
.
namespace
,
shared_runners_enabled:
true
)
end
it
'shows quota'
do
visit
admin_users_path
click_link
user
.
name
expect
(
page
).
to
have_content
(
'Pipeline minutes quota: 0 / 500'
)
end
end
context
'without projects with shared runners enabled'
do
before
do
create
(
:project
,
namespace:
user
.
namespace
,
shared_runners_enabled:
false
)
end
it
'does not show quota'
do
visit
admin_users_path
click_link
user
.
name
expect
(
page
).
not_to
have_content
(
'Pipeline minutes quota:'
)
end
end
end
end
describe
"GET /admin/users/:id/edit"
do
before
do
visit
admin_users_path
click_link
"edit_user_
#{
user
.
id
}
"
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
).
not_to
be_admin
expect
(
user
).
to
be_auditor
end
end
describe
'Update shared runners quota'
do
let!
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
,
shared_runners_enabled:
true
)
}
before
do
fill_in
"user_namespace_attributes_shared_runners_minutes_limit"
,
with:
"500"
click_button
"Save changes"
end
it
"shows page with new data"
do
expect
(
page
).
to
have_content
(
'Pipeline minutes quota: 0 / 500'
)
end
end
end
end
spec/features/admin/admin_users_spec.rb
View file @
3b3aeb04
...
...
@@ -419,40 +419,6 @@ describe "Admin::Users" do
end
end
end
describe
'Shared runners quota status'
do
before
do
user
.
namespace
.
update
(
shared_runners_minutes_limit:
500
)
end
context
'with projects with shared runners enabled'
do
before
do
create
(
:project
,
namespace:
user
.
namespace
,
shared_runners_enabled:
true
)
end
it
'shows quota'
do
visit
admin_users_path
click_link
user
.
name
expect
(
page
).
to
have_content
(
'Pipeline minutes quota: 0 / 500'
)
end
end
context
'without projects with shared runners enabled'
do
before
do
create
(
:project
,
namespace:
user
.
namespace
,
shared_runners_enabled:
false
)
end
it
'does not show quota'
do
visit
admin_users_path
click_link
user
.
name
expect
(
page
).
not_to
have_content
(
'Pipeline minutes quota:'
)
end
end
end
end
describe
"GET /admin/users/:id/edit"
do
...
...
@@ -489,21 +455,6 @@ describe "Admin::Users" 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
).
not_to
be_admin
expect
(
user
).
to
be_auditor
end
end
describe
'update username to non ascii char'
do
it
do
fill_in
'user_username'
,
with:
'\u3042\u3044'
...
...
@@ -516,19 +467,6 @@ describe "Admin::Users" do
expect
(
page
).
to
have_selector
(
%(form[action="/admin/users/#{user.username}"])
)
end
end
describe
'Update shared runners quota'
do
let!
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
,
shared_runners_enabled:
true
)
}
before
do
fill_in
"user_namespace_attributes_shared_runners_minutes_limit"
,
with:
"500"
click_button
"Save changes"
end
it
"shows page with new data"
do
expect
(
page
).
to
have_content
(
'Pipeline minutes quota: 0 / 500'
)
end
end
end
describe
"GET /admin/users/:id/projects"
do
...
...
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