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
899686aa
Commit
899686aa
authored
May 28, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `let_it_be` to speed up specs
parent
57757944
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ee/spec/services/security/store_reports_service_spec.rb
ee/spec/services/security/store_reports_service_spec.rb
+5
-5
No files found.
ee/spec/services/security/store_reports_service_spec.rb
View file @
899686aa
...
...
@@ -3,10 +3,10 @@
require
'spec_helper'
RSpec
.
describe
Security
::
StoreReportsService
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
_it_be
(
:user
)
{
create
(
:user
)
}
let
_it_be
(
:group
)
{
create
(
:group
)
}
let
_it_be
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let
_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
describe
'#execute'
do
subject
(
:execute_service_object
)
{
described_class
.
new
(
pipeline
).
execute
}
...
...
@@ -38,7 +38,7 @@ RSpec.describe Security::StoreReportsService do
end
it
'updates the `latest_pipeline_id` attribute of the associated `vulnerability_statistic` record'
do
expect
{
execute_service_object
}.
to
change
{
project
.
vulnerability_statistic
&
.
latest_pipeline_id
}.
from
(
nil
).
to
(
pipeline
.
id
)
expect
{
execute_service_object
}.
to
change
{
project
.
reload
.
vulnerability_statistic
&
.
latest_pipeline_id
}.
from
(
nil
).
to
(
pipeline
.
id
)
end
context
'when StoreReportService returns an error for a report'
do
...
...
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