Skip to content

Commit

Permalink
all tests for valid? passing
Browse files Browse the repository at this point in the history
  • Loading branch information
AGarrow committed May 30, 2013
1 parent 4fff2d0 commit 4be6960
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions coverage/.resultset.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@
null,
null,
null,
null,
1,
2,
null,
Expand All @@ -601,6 +600,6 @@
null
]
},
"timestamp": 1369861766
"timestamp": 1369923152
}
}
2 changes: 1 addition & 1 deletion lib/multi_mail/mandrill/receiver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def valid?(params)
signed_data << (key.to_s + value.to_s)
end
key = Base64.encode64(Digest::HMAC.digest(signed_data,@mandrill_webhook_key,Digest::SHA1)).strip
key == params['env']['HTTP_X_MANDRILL_SIGNATURE']
key == params.fetch('env').fetch('HTTP_X_MANDRILL_SIGNATURE')
end

# Returns whether a message is spam.
Expand Down
6 changes: 3 additions & 3 deletions spec/mandrill/receiver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def params(fixture)
service.valid?(params('invalid')).should == false
end

# it 'should raise an error if parameters are missing' do
# expect{ service.valid?(params('missing')) }.to raise_error(IndexError)
# end
it 'should raise an error if parameters are missing' do
expect{ service.valid?(params('missing')) }.to raise_error(IndexError)
end
end


Expand Down

0 comments on commit 4be6960

Please sign in to comment.