Sha256: 0d0fe6dde85b806932ad719ed752dcdedf40e8a8928f2283f74fef3b696fa6e9

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

require 'test_helper'

class SignatureTest < Minitest::Test
  def setup
    #@expected_base64 = "F8zvW31wDYENPZrwkVYaPOLHh2R+goZncb0SlwTwyes="
    @expected_base64 = "JYhNqz8a5iDPZn+igV4ixr3MdU3A+1w6rQR0ocneNLU="
    @expected_digest = Base64.decode64(@expected_base64) #TODO this is a cop out
    #@expected_digest = "\027\314\357[}p\r\201\r=\232\360\221V\032<\342\307\207d~\202\206gq\275\022\227\004\360\311\353"
  end

  def test_sign_with_string_keys
    signature = Amazon::MWS::Authentication::Signature.new(
      {"devil" => "666"},
      {:verb => :get, :secret_access_key => "beelzebub"}
    )

    # Not sure if this really helps, just locks it down
    assert_equal(@expected_base64, signature)
    assert_equal(@expected_digest, Base64.decode64(signature))
  end

  def test_sign_with_symbol_keys
    signature = Amazon::MWS::Authentication::Signature.new(
      {:devil => "666"},
      {:verb => :get, :secret_access_key => "beelzebub"}
    )

    # Not sure if this really helps, just locks it down
    assert_equal(@expected_base64, signature)
    assert_equal(@expected_digest, Base64.decode64(signature))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
amazon-mws-plus-0.1.3 test/signature_test.rb