Commit 15001008 authored by charlieablett's avatar charlieablett

Remove redundant check

parent cd4e4045
...@@ -50,10 +50,7 @@ module Spam ...@@ -50,10 +50,7 @@ module Spam
# @TODO metrics/logging # @TODO metrics/logging
# Expecting: # Expecting:
# error: (string or nil) # error: (string or nil)
# result: (string or nil) # verdict: (string or nil)
verdict = json_result[:verdict]
return unless SUPPORTED_VERDICTS.include?(verdict)
# @TODO log if json_result[:error] # @TODO log if json_result[:error]
json_result[:verdict] json_result[:verdict]
......
...@@ -192,8 +192,8 @@ describe Spam::SpamVerdictService do ...@@ -192,8 +192,8 @@ describe Spam::SpamVerdictService do
context 'the verdict is an unexpected string' do context 'the verdict is an unexpected string' do
let(:verdict) { 'this is fine' } let(:verdict) { 'this is fine' }
it 'returns nil' do it 'returns the string' do
expect(subject).to be_nil expect(subject).to eq verdict
end end
end end
...@@ -209,7 +209,7 @@ describe Spam::SpamVerdictService do ...@@ -209,7 +209,7 @@ describe Spam::SpamVerdictService do
let(:verdict) { '' } let(:verdict) { '' }
it 'returns nil' do it 'returns nil' do
expect(subject).to be_nil expect(subject).to eq verdict
end end
end 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