Sha256: b5016d85638a7ff0e19cc4c7d540817680e87acb8172e024b2889dd0c9fe8416

Contents?: true

Size: 887 Bytes

Versions: 6

Compression:

Stored size: 887 Bytes

Contents

require 'test/test_helper'

class VultrAccountTest < Minitest::Test

  # Called before every test method runs. Can be used
  # to set up fixture information.
  def setup
    Vultr.api_key = ENV['VULTR_API_KEY']
  end

  def test_account_info_url
    account_info_url = 'https://api.vultr.com/v1/account/info?api_key=' + Vultr.api_key
    assert_equal account_info_url, Vultr::Account._info
  end

  def test_account_info_response
    r = Vultr::Account.info

    assert r.has_key? :status
    assert_equal r[:status], 200

    assert r.has_key? :result
    assert r[:result].has_key? 'balance'
    assert r[:result].has_key? 'pending_charges'
    assert r[:result].has_key? 'last_payment_date'
    assert r[:result].has_key? 'last_payment_amount'
  end

  # Called after every test method runs. Can be used to tear
  # down fixture information.
  def teardown
    # Do nothing
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vultr-0.3.5 test/vultr/vultr_account_test.rb
vultr-0.3.4 test/vultr/vultr_account_test.rb
vultr-0.3.3 test/vultr/vultr_account_test.rb
vultr-0.3.2 test/vultr/vultr_account_test.rb
vultr-0.3.1 test/vultr/vultr_account_test.rb
vultr-0.2.1 test/vultr/vultr_account_test.rb