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
0aab0dd1
Commit
0aab0dd1
authored
Jan 29, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove rubocop cop disable
parent
f192d901
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
23 deletions
+19
-23
ee/spec/migrations/update_occurrence_severity_column_spec.rb
ee/spec/migrations/update_occurrence_severity_column_spec.rb
+19
-23
No files found.
ee/spec/migrations/update_occurrence_severity_column_spec.rb
View file @
0aab0dd1
...
...
@@ -8,8 +8,7 @@ RSpec.describe UpdateOccurrenceSeverityColumn do
let
(
:identifiers
)
{
table
(
:vulnerability_identifiers
)
}
let
(
:scanners
)
{
table
(
:vulnerability_scanners
)
}
let
(
:projects
)
{
table
(
:projects
)
}
let
(
:vul1
)
{
attributes_for
(
:vulnerabilities_finding
,
id:
1
,
report_type:
2
,
confidence:
5
)
}
# rubocop: disable RSpec/FactoriesInMigrationSpecs
let
(
:vul2
)
{
attributes_for
(
:vulnerabilities_finding
,
id:
2
,
report_type:
2
,
confidence:
5
)
}
# rubocop: disable RSpec/FactoriesInMigrationSpecs
let
(
:location_fingerprint
)
{
'4e5b6966dd100170b4b1ad599c7058cce91b57b4'
}
before
do
stub_const
(
"
#{
described_class
}
::BATCH_SIZE"
,
2
)
...
...
@@ -36,33 +35,31 @@ RSpec.describe UpdateOccurrenceSeverityColumn do
scanners
.
create!
(
id:
6
,
project_id:
123
,
external_id:
'clair'
,
name:
'Security Scanner'
)
vulnerabilities
.
create!
(
id:
vul1
[
:id
],
severity:
0
,
vulnerabilities
.
create!
(
severity:
0
,
confidence:
5
,
report_type:
2
,
project_id:
123
,
scanner_id:
6
,
primary_identifier_id:
1
,
project_fingerprint:
vul1
[
:project_fingerprint
]
,
location_fingerprint:
vul1
[
:location_fingerprint
]
,
uuid:
vul1
[
:uuid
]
,
name:
vul1
[
:name
]
,
project_fingerprint:
Digest
::
SHA1
.
hexdigest
(
SecureRandom
.
uuid
)
,
location_fingerprint:
location_fingerprint
,
uuid:
SecureRandom
.
uuid
,
name:
'Cipher with no integrity'
,
metadata_version:
'1.3'
,
raw_metadata:
vul1
[
:raw_metadata
]
)
raw_metadata:
'{}'
)
vulnerabilities
.
create!
(
id:
vul2
[
:id
],
severity:
2
,
vulnerabilities
.
create!
(
severity:
2
,
confidence:
5
,
report_type:
2
,
project_id:
123
,
scanner_id:
6
,
primary_identifier_id:
2
,
project_fingerprint:
vul2
[
:project_fingerprint
]
,
location_fingerprint:
vul2
[
:location_fingerprint
]
,
uuid:
vul2
[
:uuid
]
,
name:
vul2
[
:name
]
,
project_fingerprint:
Digest
::
SHA1
.
hexdigest
(
SecureRandom
.
uuid
)
,
location_fingerprint:
location_fingerprint
,
uuid:
SecureRandom
.
uuid
,
name:
'Cipher with no integrity'
,
metadata_version:
'1.3'
,
raw_metadata:
vul2
[
:raw_metadata
]
)
raw_metadata:
'{}'
)
expect
(
vulnerabilities
.
where
(
severity:
0
).
count
).
to
eq
(
1
)
...
...
@@ -85,19 +82,18 @@ RSpec.describe UpdateOccurrenceSeverityColumn do
scanners
.
create!
(
id:
6
,
project_id:
123
,
external_id:
'clair'
,
name:
'Security Scanner'
)
vulnerabilities
.
create!
(
id:
vul1
[
:id
],
severity:
0
,
vulnerabilities
.
create!
(
severity:
0
,
confidence:
5
,
report_type:
2
,
project_id:
123
,
scanner_id:
6
,
primary_identifier_id:
1
,
project_fingerprint:
vul1
[
:project_fingerprint
]
,
location_fingerprint:
vul1
[
:location_fingerprint
]
,
uuid:
vul1
[
:uuid
]
,
name:
vul1
[
:name
]
,
project_fingerprint:
generate
(
:project_fingerprint
)
,
location_fingerprint:
location_fingerprint
,
uuid:
SecureRandom
.
uuid
,
name:
'Cipher with no integrity'
,
metadata_version:
'1.3'
,
raw_metadata:
vul1
[
:raw_metadata
]
)
raw_metadata:
'{}'
)
expect
(
vulnerabilities
.
where
(
severity:
0
).
count
).
to
eq
(
1
)
...
...
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