These are chat archives for rebelidealist/stripe-ruby-mock

Apr 2016
Lemuel Barango
Apr 21 2016 16:00
      :bank_name => "Memory Bank",
      :last4 => "7171"
Apr 21 2016 16:33

@lemuelbarango creation test:

    it 'can create a new bank account' do
    bank_account = StripeMock.generate_bank_token(
      :bank_name => "Memory Bank",
      :last4 => "7171"

    verified_bank_account = Stripe.retrieve(
    expect(verified_bank_account.last4).to eq '7171'
    expect(verified_bank_account.bank_name)).to eq 'Memory Bank'

charge test: i am short on time, so providing a normal account charge test, which you can modify for the bank account, hope this helps, and if not, i will work on it later as this is something we will using.

 context 'Bank Charge API', live: true do
     let(:stripe_helper) { StripeMock.create_test_helper }

  it "creates a stripe charge item with a card token" do
    charge = Stripe::Charge.create({
      amount: 900,
      currency: 'usd',
      interval: 'month',
      source: stripe_helper.generate_card_token(card_number: 4242424242424242, exp_month: 9, exp_year: 2019),
      description: "Charge for",
      }, {
        idempotency_key: "95ea4310438306ch"
    expect( match /^test\_ch/
    expect(charge.amount).to eq 900
    expect(charge.description).to eq "Charge for"
    expect(charge.captured).to eq true
    expect(charge.interval).to eq 'month'
the first is untested, the second passes a normal charge, and should be adapted for bank account.