Sha256: 824fdd6647540a550f1df2bc0c5ff00cd7ae4b2417ddfe46dfc7a5e810463946
Contents?: true
Size: 1.09 KB
Versions: 4
Compression:
Stored size: 1.09 KB
Contents
require File.expand_path('../../test_helper', __FILE__) module Stripe class AccountTest < Test::Unit::TestCase should "account should be retrievable" do resp = {:email => "test+bindings@stripe.com", :charge_enabled => false, :details_submitted => false} @mock.expects(:get).once.returns(test_response(resp)) a = Stripe::Account.retrieve assert_equal "test+bindings@stripe.com", a.email assert !a.charge_enabled assert !a.details_submitted end should "be able to deauthorize an account" do resp = {:id => 'acct_1234', :email => "test+bindings@stripe.com", :charge_enabled => false, :details_submitted => false} @mock.expects(:get).once.returns(test_response(resp)) a = Stripe::Account.retrieve @mock.expects(:post).once.with do |url, api_key, params| url == "#{Stripe.connect_base}/oauth/deauthorize" && api_key.nil? && CGI.parse(params) == { 'client_id' => [ 'ca_1234' ], 'stripe_user_id' => [ a.id ]} end.returns(test_response({ 'stripe_user_id' => a.id })) a.deauthorize('ca_1234', 'sk_test_1234') end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
stripe-1.18.0 | test/stripe/account_test.rb |
stripe-1.17.3 | test/stripe/account_test.rb |
stripe-1.17.2 | test/stripe/account_test.rb |
stripe-1.17.1 | test/stripe/account_test.rb |