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
37ac06f6
Commit
37ac06f6
authored
Dec 24, 2020
by
Saikat Sarkar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more tests in request API spec for sast configuration
parent
28a2f781
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
ee/spec/graphql/mutations/security/ci_configuration/configure_sast_spec.rb
...utations/security/ci_configuration/configure_sast_spec.rb
+20
-0
No files found.
ee/spec/graphql/mutations/security/ci_configuration/configure_sast_spec.rb
View file @
37ac06f6
...
...
@@ -63,6 +63,26 @@ RSpec.describe Mutations::Security::CiConfiguration::ConfigureSast do
end
end
context
'when the user does not have permission to create a new branch'
do
before_all
do
project
.
add_developer
(
user
)
end
let
(
:error_message
)
{
'You are not allowed to create protected branches on this project.'
}
it
'returns an array of errors'
do
allow_next_instance_of
(
::
Files
::
MultiService
)
do
|
multi_service
|
allow
(
multi_service
).
to
receive
(
:execute
).
and_raise
(
Gitlab
::
Git
::
PreReceiveError
.
new
(
"GitLab:
#{
error_message
}
"
))
end
expect
(
result
).
to
match
(
status: :error
,
success_path:
nil
,
errors:
match_array
([
error_message
])
)
end
end
context
'when the user can create a merge request'
do
before_all
do
project
.
add_developer
(
user
)
...
...
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