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
edd4c195
Commit
edd4c195
authored
Oct 20, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Vulnerabilities::Feedback#finding method
parent
57f52e00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
ee/app/models/vulnerabilities/feedback.rb
ee/app/models/vulnerabilities/feedback.rb
+8
-0
ee/spec/models/vulnerabilities/feedback_spec.rb
ee/spec/models/vulnerabilities/feedback_spec.rb
+21
-0
No files found.
ee/app/models/vulnerabilities/feedback.rb
View file @
edd4c195
...
...
@@ -90,5 +90,13 @@ module Vulnerabilities
def
touch_pipeline
pipeline
&
.
touch
end
def
finding
Finding
.
find_by
(
project_id:
project_id
,
report_type:
category
,
project_fingerprint:
project_fingerprint
)
end
end
end
ee/spec/models/vulnerabilities/feedback_spec.rb
View file @
edd4c195
...
...
@@ -235,4 +235,25 @@ RSpec.describe Vulnerabilities::Feedback do
it
{
is_expected
.
to
eq
({
project_id:
project
.
id
,
category:
category
,
project_fingerprint:
project_fingerprint
})
}
end
describe
'#finding'
do
let_it_be
(
:feedback
)
{
create
(
:vulnerability_feedback
)
}
subject
{
feedback
.
finding
}
context
'when the is no finding persisted'
do
it
{
is_expected
.
to
be_nil
}
end
context
'when there is a persisted finding'
do
let!
(
:finding
)
do
create
(
:vulnerabilities_finding
,
project:
feedback
.
project
,
report_type:
feedback
.
category
,
project_fingerprint:
feedback
.
project_fingerprint
)
end
it
{
is_expected
.
to
eq
(
finding
)
}
end
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