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
0fb493ee
Commit
0fb493ee
authored
Aug 03, 2021
by
Pedro Pombeiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GroupSharedRunnersSettingUpdate request spec
parent
2bbc69a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
spec/requests/api/graphql/mutations/groups/update_shared_runners_setting_spec.rb
...ql/mutations/groups/update_shared_runners_setting_spec.rb
+66
-0
No files found.
spec/requests/api/graphql/mutations/groups/update_shared_runners_setting_spec.rb
0 → 100644
View file @
0fb493ee
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'GroupSharedRunnersSettingUpdate'
do
include
GraphqlHelpers
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be_with_reload
(
:group
)
{
create
(
:group
)
}
let
(
:variables
)
do
{
full_path:
group
.
full_path
,
shared_runners_setting:
'DISABLED_WITH_OVERRIDE'
}
end
let
(
:mutation
)
{
graphql_mutation
(
:group_shared_runners_setting_update
,
variables
)
}
context
'when unauthorized'
do
shared_examples
'unauthorized'
do
it
'returns an error'
do
post_graphql_mutation
(
mutation
,
current_user:
user
)
expect
(
graphql_errors
).
not_to
be_empty
end
end
context
'when not a group member'
do
it_behaves_like
'unauthorized'
end
context
'when a non-admin group member'
do
before
do
group
.
add_developer
(
user
)
end
it_behaves_like
'unauthorized'
end
end
context
'when authorized'
do
before
do
group
.
add_owner
(
user
)
end
it
'updates shared runners settings'
do
post_graphql_mutation
(
mutation
,
current_user:
user
)
expect
(
response
).
to
have_gitlab_http_status
(
:success
)
expect
(
graphql_errors
).
to
be_nil
expect
(
group
.
reload
.
shared_runners_setting
).
to
eq
(
variables
[
:shared_runners_setting
].
downcase
)
end
context
'when bad arguments are provided'
do
let
(
:variables
)
{
{
full_path:
''
,
shared_runners_setting:
'INVALID'
}
}
it
'returns the errors'
do
post_graphql_mutation
(
mutation
,
current_user:
user
)
expect
(
graphql_errors
).
not_to
be_empty
expect
(
group
.
reload
.
shared_runners_setting
).
to
eq
(
'enabled'
)
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