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
31996cf3
Commit
31996cf3
authored
Sep 02, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `let_it_be` to speed up the specs
parent
4ce98144
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
ee/spec/services/security/store_findings_metadata_service_spec.rb
...services/security/store_findings_metadata_service_spec.rb
+9
-5
No files found.
ee/spec/services/security/store_findings_metadata_service_spec.rb
View file @
31996cf3
...
...
@@ -3,11 +3,11 @@
require
'spec_helper'
RSpec
.
describe
Security
::
StoreFindingsMetadataService
do
let
(
:security_scan
)
{
create
(
:security_scan
)
}
let
(
:project
)
{
security_scan
.
project
}
let
(
:security_finding
)
{
build
(
:ci_reports_security_finding
)
}
let
(
:security_scanner
)
{
build
(
:ci_reports_security_scanner
)
}
let
(
:report
)
do
let
_it_be
(
:security_scan
)
{
create
(
:security_scan
)
}
let
_it_be
(
:project
)
{
security_scan
.
project
}
let
_it_be
(
:security_finding
)
{
build
(
:ci_reports_security_finding
)
}
let
_it_be
(
:security_scanner
)
{
build
(
:ci_reports_security_scanner
)
}
let
_it_be
(
:report
)
do
build
(
:ci_reports_security_report
,
findings:
[
security_finding
],
...
...
@@ -31,6 +31,10 @@ RSpec.describe Security::StoreFindingsMetadataService do
end
context
'when the given security scan does not have any findings'
do
before
do
security_scan
.
findings
.
delete_all
end
it
'creates the security finding entries in database'
do
expect
{
store_findings
}.
to
change
{
security_scan
.
findings
.
count
}.
by
(
1
)
.
and
change
{
security_scan
.
findings
.
last
&
.
severity
}.
to
(
security_finding
.
severity
.
to_s
)
...
...
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