Sha256: a535972ecd0e4a6e2cb5021d4ad9e5144616d8f2cf10b548c59856cd1c89e8af

Contents?: true

Size: 680 Bytes

Versions: 5

Compression:

Stored size: 680 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class GetItemsTest < Test::Unit::TestCase
  include TestHelper

  def setup
    @gateway = XeroGateway::Gateway.new(CONSUMER_KEY, CONSUMER_SECRET)

    if STUB_XERO_CALLS
      @gateway.xero_url = "DUMMY_URL"

      @gateway.stubs(:http_get).with {|client, url, params| url =~ /Items$/ }.returns(get_file_as_string("items.xml"))
    end
  end

  def test_get_items
    result = @gateway.get_items
    assert result.success?
    assert !result.response_xml.nil?

    assert result.items.size > 0
    assert_equal XeroGateway::Item, result.items.first.class
    assert_equal "An Untracked Item", result.items.first.name
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
xero_gateway-2.7.0 test/integration/get_items_test.rb
xero_gateway-2.6.0 test/integration/get_items_test.rb
xero_gateway-2.5.0 test/integration/get_items_test.rb
xero_gateway-2.4.0 test/integration/get_items_test.rb
xero_gateway-2.3.0 test/integration/get_items_test.rb