Sha256: 278a57c9b6c3299ce80822538d5a73e1f67ae937229514af2de578a2c911e9e8
Contents?: true
Size: 544 Bytes
Versions: 12
Compression:
Stored size: 544 Bytes
Contents
require 'test_helper' class Alipay::SignTest < Test::Unit::TestCase def setup @params = { :service => 'test', :partner => '123' } @sign = Digest::MD5.hexdigest("partner=123&service=test#{Alipay.key}") end def test_generate_sign assert_equal @sign, Alipay::Sign.generate(@params) end def test_verify_sign assert Alipay::Sign.verify?(@params.merge(:sign => @sign)) end def test_verify_sign_when_fails assert !Alipay::Sign.verify?(@params.merge(:danger => 'danger', :sign => @sign)) end end
Version data entries
12 entries across 12 versions & 1 rubygems