Sha256: 2d1ce791d66b6276041056aff02a9bac207b9a92db2d047f92ab706c93cc7775

Contents?: true

Size: 1.51 KB

Versions: 12

Compression:

Stored size: 1.51 KB

Contents

require 'spec_helper'

describe Conekta::Payout do
  include_context "API 1.0.0"
  let(:payee_attributes) do
    {
      name: "John Doe", email: "j_d@radcorp.com", phone: "555555555",
      billing_address:{
        company_name: 'Rad Corp',
        tax_id: 'tax121212abc',
        street1: 'Guadalupe 73',
        street2: 'Despacho 32',
        street3: 'Condesa',
        city: 'Cuauhtemoc',
        state: 'DF',
        country: 'MX',
        zip: '06100'
      }
    }
  end

  let(:bank_attributes) do
    {
      account_number: '032180000118359719',
      account_holder: 'J D - Radcorp',
      description: 'Conekta To JD',
      statement_description: 'Conekta To JD 111111111',
      statement_reference: '111111111'
    }
  end

  describe 'an instance' do
    before do
      payee = Conekta::Payee.create(payee_attributes)
      payout_method = payee.create_payout_method(bank_attributes)

      @payee = Conekta::Payee.find(payee.id)
    end

    it 'is created successfully' do
      payout = Conekta::Payout.create(
        amount: 5000, currency: "MXN", payee: @payee.id
      )
      expect(payout).to be_a(Conekta::Payout)
    end

    it 'can be retrieved by :id' do
      transaction = Conekta::Payout.create(
        amount: 5000, currency: "MXN", payee: @payee.id
      )
      # refetch payout
      payout = Conekta::Payout.find(transaction.id)
      expect(payout).to be_a(Conekta::Payout)
    end

    it 'has a :method attribute' do
      expect(@payee.payout_methods.first).to be_a(Conekta::Method)
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
conekta-2.6.0 spec/conekta/1.0.0/payout_spec.rb
conekta-tiempometa-2.4.2 spec/conekta/1.0.0/payout_spec.rb
conekta-2.5.0 spec/conekta/1.0.0/payout_spec.rb
conekta-2.4.2 spec/conekta/1.0.0/payout_spec.rb
conekta-2.4.1 spec/conekta/1.0.0/payout_spec.rb
conekta-2.4.0 spec/conekta/1.0.0/payout_spec.rb
conekta-2.3.0 spec/conekta/1.0.0/payout_spec.rb
conekta-2.0.0 spec/conekta/1.0.0/payout_spec.rb
conekta-1.1.3 spec/conekta/1.0.0/payout_spec.rb
conekta-1.1.2 spec/conekta/1.0.0/payout_spec.rb
conekta-1.1.1 spec/conekta/1.0.0/payout_spec.rb
conekta-1.1.0 spec/conekta/1.0.0/payout_spec.rb