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
15001008
Commit
15001008
authored
Jun 19, 2020
by
charlieablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant check
parent
cd4e4045
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
app/services/spam/spam_verdict_service.rb
app/services/spam/spam_verdict_service.rb
+1
-4
spec/services/spam/spam_verdict_service_spec.rb
spec/services/spam/spam_verdict_service_spec.rb
+3
-3
No files found.
app/services/spam/spam_verdict_service.rb
View file @
15001008
...
...
@@ -50,10 +50,7 @@ module Spam
# @TODO metrics/logging
# Expecting:
# error: (string or nil)
# result: (string or nil)
verdict
=
json_result
[
:verdict
]
return
unless
SUPPORTED_VERDICTS
.
include?
(
verdict
)
# verdict: (string or nil)
# @TODO log if json_result[:error]
json_result
[
:verdict
]
...
...
spec/services/spam/spam_verdict_service_spec.rb
View file @
15001008
...
...
@@ -192,8 +192,8 @@ describe Spam::SpamVerdictService do
context
'the verdict is an unexpected string'
do
let
(
:verdict
)
{
'this is fine'
}
it
'returns
nil
'
do
expect
(
subject
).
to
be_nil
it
'returns
the string
'
do
expect
(
subject
).
to
eq
verdict
end
end
...
...
@@ -209,7 +209,7 @@ describe Spam::SpamVerdictService do
let
(
:verdict
)
{
''
}
it
'returns nil'
do
expect
(
subject
).
to
be_nil
expect
(
subject
).
to
eq
verdict
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