Sha256: 878a442c77d5398d4faa06b7e10f7573571930c1ff784a24899a6571f823a42b

Contents?: true

Size: 636 Bytes

Versions: 101

Compression:

Stored size: 636 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

class FakeDigest
  def self.hexdigest(key, string)
    "#{string}_signed_with_#{key}"
  end
end

describe Braintree::SignatureService do
  describe "sign" do
    it "signs the data with its key" do
      service = Braintree::SignatureService.new("my_key", FakeDigest)

      service.sign(:foo => "foo bar").should == "foo=foo+bar_signed_with_my_key|foo=foo+bar"
    end
  end

  describe "hash" do
    it "hashes the string with its key" do
      Braintree::SignatureService.new("my_key", FakeDigest).hash("foo").should == "foo_signed_with_my_key"
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
braintree-4.14.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.13.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.12.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.11.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.10.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.9.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.8.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.7.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.6.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.5.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.4.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.3.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.2.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.1.0 spec/unit/braintree/signature_service_spec.rb
braintree-4.0.0 spec/unit/braintree/signature_service_spec.rb
braintree-3.4.0 spec/unit/braintree/signature_service_spec.rb
braintree-3.3.0 spec/unit/braintree/signature_service_spec.rb
braintree-3.2.0 spec/unit/braintree/signature_service_spec.rb
braintree-3.1.0 spec/unit/braintree/signature_service_spec.rb
braintree-3.0.1 spec/unit/braintree/signature_service_spec.rb