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
3e127ae6
Commit
3e127ae6
authored
Jul 08, 2019
by
Avielle Wolfe
Committed by
Bob Van Landuyt
Jul 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Vulnerable shared specs agnostic
parent
c7fef435
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
ee/spec/models/group_spec.rb
ee/spec/models/group_spec.rb
+4
-1
ee/spec/support/shared_examples/models/concerns/vulnerable_shared_examples.rb
...ed_examples/models/concerns/vulnerable_shared_examples.rb
+6
-6
No files found.
ee/spec/models/group_spec.rb
View file @
3e127ae6
...
...
@@ -3,7 +3,10 @@ require 'spec_helper'
describe
Group
do
let
(
:group
)
{
create
(
:group
)
}
it_behaves_like
Vulnerable
it_behaves_like
Vulnerable
do
let
(
:vulnerable
)
{
group
}
end
it
{
is_expected
.
to
include_module
(
EE
::
Group
)
}
describe
'associations'
do
...
...
ee/spec/support/shared_examples/models/concerns/vulnerable_shared_examples.rb
View file @
3e127ae6
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
shared_examples_for
Vulnerable
do
let
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
vulnerable
)
}
let
(
:external_project
)
{
create
(
:project
)
}
let
(
:failed_pipeline
)
{
create
(
:ci_pipeline
,
:failed
,
project:
project
)
}
...
...
@@ -23,7 +23,7 @@ shared_examples_for Vulnerable do
end
describe
'#latest_vulnerabilities'
do
subject
{
group
.
latest_vulnerabilities
}
subject
{
vulnerable
.
latest_vulnerabilities
}
it
'returns vulnerabilities for the latest successful pipelines of projects belonging to the vulnerable entity'
do
is_expected
.
to
contain_exactly
(
new_vuln
)
...
...
@@ -43,9 +43,9 @@ shared_examples_for Vulnerable do
end
describe
'#latest_vulnerabilities_with_sha'
do
subject
{
group
.
latest_vulnerabilities_with_sha
}
subject
{
vulnerable
.
latest_vulnerabilities_with_sha
}
it
'returns vulns only for the latest successful pipelines of projects belonging to the
group
'
do
it
'returns vulns only for the latest successful pipelines of projects belonging to the
vulnerable
'
do
is_expected
.
to
contain_exactly
(
new_vuln
)
end
...
...
@@ -65,9 +65,9 @@ shared_examples_for Vulnerable do
end
describe
'#all_vulnerabilities'
do
subject
{
group
.
all_vulnerabilities
}
subject
{
vulnerable
.
all_vulnerabilities
}
it
'returns vulns for all successful pipelines of projects belonging to the
group
'
do
it
'returns vulns for all successful pipelines of projects belonging to the
vulnerable
'
do
is_expected
.
to
contain_exactly
(
old_vuln
,
new_vuln
,
new_vuln
)
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