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
d063fc83
Commit
d063fc83
authored
Apr 30, 2021
by
agroleau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applied Stan's latest recommended changes
parent
0f0ff422
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app/services/spam/spam_verdict_service.rb
app/services/spam/spam_verdict_service.rb
+1
-1
spec/lib/gitlab/spamcheck/client_spec.rb
spec/lib/gitlab/spamcheck/client_spec.rb
+4
-4
No files found.
app/services/spam/spam_verdict_service.rb
View file @
d063fc83
...
...
@@ -31,7 +31,7 @@ module Spam
# Favour the most restrictive result.
final_verdict
=
valid_results
.
min_by
{
|
v
|
SUPPORTED_VERDICTS
[
v
][
:priority
]
}
logger
.
info
(
source:
'spam_verdict_service.rb'
,
logger
.
info
(
class:
self
.
class
.
name
,
akismet_verdict:
akismet_verdict
,
spam_check_verdict:
spamcheck_result
,
spam_check_rtt:
external_spam_check_round_trip_time
.
real
,
...
...
spec/lib/gitlab/spamcheck/client_spec.rb
View file @
d063fc83
...
...
@@ -58,8 +58,8 @@ RSpec.describe Gitlab::Spamcheck::Client do
expect
(
issue_pb
.
title
).
to
eq
issue
.
title
expect
(
issue_pb
.
description
).
to
eq
issue
.
description
expect
(
issue_pb
.
user_in_project
).
to
be
false
expect
(
issue_pb
.
created_at
).
to
eq
timestamp_to_protobuf_tim
stampe
(
issue
.
created_at
)
expect
(
issue_pb
.
updated_at
).
to
eq
timestamp_to_protobuf_tim
stampe
(
issue
.
updated_at
)
expect
(
issue_pb
.
created_at
).
to
eq
timestamp_to_protobuf_tim
estamp
(
issue
.
created_at
)
expect
(
issue_pb
.
updated_at
).
to
eq
timestamp_to_protobuf_tim
estamp
(
issue
.
updated_at
)
expect
(
issue_pb
.
action
).
to
be
::
Spamcheck
::
Action
.
lookup
(
::
Spamcheck
::
Action
::
CREATE
)
expect
(
issue_pb
.
user
.
username
).
to
eq
user
.
username
end
...
...
@@ -70,7 +70,7 @@ RSpec.describe Gitlab::Spamcheck::Client do
user_pb
=
described_class
.
new
.
send
(
:build_user_protobuf
,
user
)
expect
(
user_pb
.
username
).
to
eq
user
.
username
expect
(
user_pb
.
org
).
to
eq
user
.
organization
expect
(
user_pb
.
created_at
).
to
eq
timestamp_to_protobuf_tim
stampe
(
user
.
created_at
)
expect
(
user_pb
.
created_at
).
to
eq
timestamp_to_protobuf_tim
estamp
(
user
.
created_at
)
expect
(
user_pb
.
emails
.
count
).
to
be
1
expect
(
user_pb
.
emails
.
first
.
email
).
to
eq
user
.
email
expect
(
user_pb
.
emails
.
first
.
verified
).
to
eq
user
.
confirmed?
...
...
@@ -96,7 +96,7 @@ RSpec.describe Gitlab::Spamcheck::Client do
private
def
timestamp_to_protobuf_tim
stampe
(
timestamp
)
def
timestamp_to_protobuf_tim
estamp
(
timestamp
)
Google
::
Protobuf
::
Timestamp
.
new
(
seconds:
timestamp
.
to_time
.
to_i
,
nanos:
timestamp
.
to_time
.
nsec
)
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