Sha256: 66a3bad0c348c68719475c78c2736fc7c2645726e19649f1c570756920b8ec49
Contents?: true
Size: 1.26 KB
Versions: 1
Compression:
Stored size: 1.26 KB
Contents
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") module Braintree describe ClientToken do describe "self.generate" do it "delegates to ClientTokenGateway#generate" do options = {:foo => :bar} client_token_gateway = double(:client_token_gateway) expect(client_token_gateway).to receive(:generate).with(options).once allow(ClientTokenGateway).to receive(:new).and_return(client_token_gateway) ClientToken.generate(options) end it "can't overwrite public_key, or created_at" do expect { Braintree::ClientToken.generate( :public_key => "bad_key", :created_at => "bad_time", ) }.to raise_error(ArgumentError, /created_at, public_key/) end end context "adding credit_card options with no customer ID" do %w(verify_card fail_on_duplicate_payment_method make_default fail_on_duplicate_payment_method_for_customer).each do |option_name| it "raises an ArgumentError if #{option_name} is present" do expect do Braintree::ClientToken.generate( option_name.to_sym => true, ) end.to raise_error(ArgumentError, /#{option_name}/) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
braintree-4.23.0 | spec/unit/braintree/client_token_spec.rb |