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
636c81c0
Commit
636c81c0
authored
Oct 10, 2019
by
Victor Zagorodny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify API tests
parent
e77bd057
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
14 deletions
+19
-14
ee/spec/requests/api/vulnerabilities_spec.rb
ee/spec/requests/api/vulnerabilities_spec.rb
+7
-7
ee/spec/requests/api/vulnerability_findings_spec.rb
ee/spec/requests/api/vulnerability_findings_spec.rb
+12
-5
ee/spec/support/shared_examples/requests/api/vulnerabilities_shared_examples.rb
..._examples/requests/api/vulnerabilities_shared_examples.rb
+0
-2
No files found.
ee/spec/requests/api/vulnerabilities_spec.rb
View file @
636c81c0
...
@@ -33,9 +33,6 @@ describe API::Vulnerabilities do
...
@@ -33,9 +33,6 @@ describe API::Vulnerabilities do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
.
map
{
|
v
|
v
[
'id'
]
}).
to
contain_exactly
(
project
.
vulnerabilities
.
second
.
id
)
expect
(
json_response
.
map
{
|
v
|
v
[
'id'
]
}).
to
contain_exactly
(
project
.
vulnerabilities
.
second
.
id
)
end
end
end
it_behaves_like
'forbids access to vulnerability-like endpoint in expected cases'
context
'when "first-class vulnerabilities" feature is disabled'
do
context
'when "first-class vulnerabilities" feature is disabled'
do
before
do
before
do
...
@@ -45,4 +42,7 @@ describe API::Vulnerabilities do
...
@@ -45,4 +42,7 @@ describe API::Vulnerabilities do
it_behaves_like
'getting list of vulnerability findings'
it_behaves_like
'getting list of vulnerability findings'
end
end
end
end
it_behaves_like
'forbids access to vulnerability-like endpoint in expected cases'
end
end
end
ee/spec/requests/api/vulnerability_findings_spec.rb
View file @
636c81c0
...
@@ -10,6 +10,12 @@ describe API::VulnerabilityFindings do
...
@@ -10,6 +10,12 @@ describe API::VulnerabilityFindings do
let
(
:project_vulnerabilities_path
)
{
"/projects/
#{
project
.
id
}
/vulnerability_findings"
}
let
(
:project_vulnerabilities_path
)
{
"/projects/
#{
project
.
id
}
/vulnerability_findings"
}
it_behaves_like
'getting list of vulnerability findings'
it_behaves_like
'getting list of vulnerability findings'
it_behaves_like
'forbids access to vulnerability-like endpoint in expected cases'
context
'with an authorized user with proper permissions'
do
before
do
project
.
add_developer
(
user
)
end
context
'when "first-class vulnerabilities" feature is disabled'
do
context
'when "first-class vulnerabilities" feature is disabled'
do
before
do
before
do
...
@@ -23,4 +29,5 @@ describe API::VulnerabilityFindings do
...
@@ -23,4 +29,5 @@ describe API::VulnerabilityFindings do
end
end
end
end
end
end
end
end
end
ee/spec/support/shared_examples/requests/api/vulnerabilities_shared_examples.rb
View file @
636c81c0
...
@@ -217,6 +217,4 @@ shared_examples 'getting list of vulnerability findings' do
...
@@ -217,6 +217,4 @@ shared_examples 'getting list of vulnerability findings' do
end
end
end
end
end
end
it_behaves_like
'forbids access to vulnerability-like endpoint in expected cases'
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