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

Version Path
yl_alipay-0.15.3 test/alipay/sign/md5_test.rb
yl_alipay-0.15.2 test/alipay/sign/md5_test.rb
alipay-0.14.0 test/alipay/sign/md5_test.rb
alipay-0.13.0 test/alipay/sign/md5_test.rb
alipay-0.12.0 test/alipay/sign/md5_test.rb
alipay-0.11.0 test/alipay/sign/md5_test.rb
alipay-0.10.0 test/alipay/sign/md5_test.rb
alipay-0.9.0 test/alipay/sign/md5_test.rb
alipay-0.8.0 test/alipay/sign/md5_test.rb
alipay-0.7.1 test/alipay/sign/md5_test.rb
alipay-0.7.0 test/alipay/sign/md5_test.rb
alipay-0.6.0 test/alipay/sign/md5_test.rb
alipay-0.6.0.beta3 test/alipay/sign/md5_test.rb
alipay-0.6.0.beta2 test/alipay/sign/md5_test.rb