Sha256: e9b86843b12e34f38ac230ef5402732f27543ea6d84ecc3c82db80378540f00c

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

require_relative '../../spec_helper'

describe MangoPay::WithdrawalContribution do

  let(:new_user) {
    MangoPay::User.create({
      'Tag' => 'test',
      'Email' => 'my@email.com',
      'FirstName' => 'John',
      'LastName' => 'Doe',
      'CanRegisterMeanOfPayment' => true
      })
  }

  let(:new_wallet) {
    MangoPay::Wallet.create({
      'Name' => 'test',
      'Owners' => [ new_user['ID'] ],
      'RaisingGoalAmount' => 10000
      })
  }

  let(:new_withdrawal_contribution) do
    withdrawal_contribution = MangoPay::WithdrawalContribution.create({
      'Tag' => 'test_withdrawal_contribution',
      'UserID' => new_user['ID'],
      'WalletID' => new_wallet['ID'],
      'AmountDeclared' => 1000
      })
  end

  describe "CREATE" do
    it "creates a withdrawal contribution to a shared wallet" do
      expect(new_withdrawal_contribution['ID']).not_to be_nil
    end
  end

  describe "GET" do
    it "fetches a withdrawal contribution" do
      withdrawal_contribution = MangoPay::WithdrawalContribution.get(new_withdrawal_contribution['ID'])
      expect(withdrawal_contribution['ID']).to eq(new_withdrawal_contribution['ID'])
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mangopay-2.0.0 spec/lib/mangopay/withdrawal_contribution_spec.rb