Sha256: 6951f2ef584ae3435317e838133188bfae99834112429f1401c28ac32377698a

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

require 'spec_helper'

describe Freee::Transfer do
  let(:client_id) { get_client_id }
  let(:secret_key) { get_secret_key }
  let(:token) { get_token }
  let(:company_id) { get_company_id }
  let(:transfer) { Freee::Transfer }

  before(:each) do
    Freee::Base.config(client_id, secret_key, token)
  end

  describe 'should be able to get client' do
    subject { transfer.list(company_id) }
    it { is_expected.not_to be_nil }
    it { is_expected.to be_instance_of(Freee::Response::Transfer) }
  end

  it 'should be get information of transfers for the company' do
    expect(transfer.list(company_id)).to include('transfers')
  end

  describe 'should be get information of first transfers for the company' do
    subject { transfer.list(company_id)['transfers'].first }

    it { is_expected.not_to be_nil }
    it { is_expected.to include('id') }
    it { is_expected.to include('company_id') }
    it { is_expected.to include('date') }
    it { is_expected.to include('amount') }
    it { is_expected.to include('from_walletable_id') }
    it { is_expected.to include('from_walletable_type') }
    it { is_expected.to include('to_walletable_type') }
    it { is_expected.to include('to_walletable_id') }
    it { is_expected.to include('description') }
  end

  describe "should be get one's information of first transfers for the company" do
    subject { transfer.list(company_id, limit: 3)['transfers'].length }

    it { is_expected.not_to be_nil }
    it { is_expected.to eq 3 }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
freee-0.3.1 spec/transfer_spec.rb
freee-0.3.0 spec/transfer_spec.rb
freee-0.2.0 spec/transfer_spec.rb
freee-0.1.0 spec/transfer_spec.rb