Commit d063fc83 authored by agroleau's avatar agroleau

Applied Stan's latest recommended changes

parent 0f0ff422
......@@ -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,
......
......@@ -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_timstampe(issue.created_at)
expect(issue_pb.updated_at).to eq timestamp_to_protobuf_timstampe(issue.updated_at)
expect(issue_pb.created_at).to eq timestamp_to_protobuf_timestamp(issue.created_at)
expect(issue_pb.updated_at).to eq timestamp_to_protobuf_timestamp(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_timstampe(user.created_at)
expect(user_pb.created_at).to eq timestamp_to_protobuf_timestamp(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_timstampe(timestamp)
def timestamp_to_protobuf_timestamp(timestamp)
Google::Protobuf::Timestamp.new(seconds: timestamp.to_time.to_i,
nanos: timestamp.to_time.nsec)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment