Sha256: 254f3d1423ad5869498443c9c4e64c85ce70dcf44af55578d1889a25bb504c56

Contents?: true

Size: 788 Bytes

Versions: 2

Compression:

Stored size: 788 Bytes

Contents

require 'spec_helper'

describe Venice::Client do
  let(:receipt_data) { "asdfzxcvjklqwer" }
  let(:client) { subject }

  describe "#verify!" do
    context "no shared_secret" do
      before do
        client.shared_secret = nil
      end

      it "should only include the receipt_data" do
        client.should_receive(:perform_post).with('receipt-data' => receipt_data)
        client.verify! receipt_data
      end
    end

    context "with a shared secret" do
      let(:secret) { "shhhhhh" }

      before do
        client.shared_secret = secret
      end

      it "should include the secret in the post" do
        client.should_receive(:perform_post).with('receipt-data' => receipt_data, 'password' => secret)
        client.verify! receipt_data
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
venice-0.2.0 spec/client_spec.rb
venice-0.1.0 spec/client_spec.rb