Sha256: 255b7572dc287ef2420e7b03bff05d265b7c38782e43e3861ed9c8db0d9013a4

Contents?: true

Size: 537 Bytes

Versions: 12

Compression:

Stored size: 537 Bytes

Contents

require 'test_helper'

class Alipay::Wap::SignTest < Minitest::Test
  def setup
    @params = {
      v: '1.0',
      sec_id: 'MD5',
      service: 'test',
      notify_data: 'notify_data'
    }
    @sign = Digest::MD5.hexdigest("service=test&v=1.0&sec_id=MD5&notify_data=notify_data#{Alipay.key}")
  end

  def test_verify_sign
    assert !Alipay::Wap::Sign.verify?(@params)
    assert !Alipay::Wap::Sign.verify?(@params.merge(sec_id: 'unknow'))
    assert Alipay::Wap::Sign.verify?(@params.merge(sign: @sign, whatever: 'x'))
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
yl_alipay-0.15.3 test/alipay/wap/sign_test.rb
yl_alipay-0.15.2 test/alipay/wap/sign_test.rb
alipay-0.14.0 test/alipay/wap/sign_test.rb
alipay-0.13.0 test/alipay/wap/sign_test.rb
alipay-0.12.0 test/alipay/wap/sign_test.rb
alipay-0.11.0 test/alipay/wap/sign_test.rb
alipay-0.10.0 test/alipay/wap/sign_test.rb
alipay-0.9.0 test/alipay/wap/sign_test.rb
alipay-0.8.0 test/alipay/wap/sign_test.rb
alipay-0.7.1 test/alipay/wap/sign_test.rb
alipay-0.7.0 test/alipay/wap/sign_test.rb
alipay-0.6.0 test/alipay/wap/sign_test.rb