Sha256: 87e36009adae007bcf738fb9f068310e11e73d2dfc1bd948547e879ae1fff02e

Contents?: true

Size: 782 Bytes

Versions: 5

Compression:

Stored size: 782 Bytes

Contents

require 'spec_helper'
require 'support/client_helper'

describe "OandaAPI::Resource::Account" do
  let(:client) { ClientHelper.client }

  it "creates a new account" do
    VCR.use_cassette("accounts.create") do
      account = client.accounts.create
      expect(account).to be_an OandaAPI::Resource::Account
    end
  end

  it "gets all accounts", :vcr do
    VCR.use_cassette("accounts.get") do
      accounts = client.accounts.get
      expect(accounts.first).to be_an OandaAPI::Resource::Account
    end
  end

  it "gets a specific account", :vcr do
    VCR.use_cassette("accounts(id).get") do
      account_id = client.accounts.get.first.account_id
      account = client.accounts(account_id).get
      expect(account).to be_an OandaAPI::Resource::Account
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
oanda_api-0.9.4 spec/oanda_api/examples/accounts_spec.rb
oanda_api-0.9.3 spec/oanda_api/examples/accounts_spec.rb
oanda_api-0.9.2 spec/oanda_api/examples/accounts_spec.rb
oanda_api-0.9.0 spec/oanda_api/examples/accounts_spec.rb
oanda_api-0.8.3 spec/oanda_api/examples/accounts_spec.rb