Sha256: 2991eb651f4417d3993b9e956e298c10a30252d839c2febc4914cfe503cb74ff
Contents?: true
Size: 485 Bytes
Versions: 14
Compression:
Stored size: 485 Bytes
Contents
require 'test_helper' class Alipay::Sign::MD5Test < Minitest::Test def setup @string = "partner=123&service=test" @sign = 'bbd13b52823b576291595f472ebcfbc2' end def test_sign assert_equal @sign, Alipay::Sign::MD5.sign(Alipay.key, @string) end def test_verify assert Alipay::Sign::MD5.verify?(Alipay.key, @string, @sign) end def test_verify_fail_when_sign_not_true assert !Alipay::Sign::MD5.verify?(Alipay.key, "danger#{@string}", @sign) end end
Version data entries
14 entries across 14 versions & 2 rubygems