Sha256: 30e815f2b01eb16a2792a6eb9c1ad9b4b207a582c0389aa9166ebb9b55efde6c

Contents?: true

Size: 953 Bytes

Versions: 31

Compression:

Stored size: 953 Bytes

Contents

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

class GetTrackingCategoriesTest < 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 =~ /TrackingCategories$/ }.returns(get_file_as_string("tracking_categories.xml"))          
    end
  end
  
  def test_get_tracking_categories
    result = @gateway.get_tracking_categories
    assert result.success?
    assert !result.response_xml.nil?
    if STUB_XERO_CALLS
      # When operating against the Xero test environment, there may not be any tracking categories present,
      # so this assertion can only be done when operating against stub responses
      assert_equal 1, result.tracking_categories.size
      assert_equal 4, result.tracking_categories.first.options.size
    end
  end
end

Version data entries

31 entries across 31 versions & 3 rubygems

Version Path
xero_gateway-2.7.0 test/integration/get_tracking_categories_test.rb
xero_gateway-2.6.0 test/integration/get_tracking_categories_test.rb
xero_gateway-2.5.0 test/integration/get_tracking_categories_test.rb
xero_gateway-2.4.0 test/integration/get_tracking_categories_test.rb
xero_gateway-2.3.0 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.1.7 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.1.6 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.1.4 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.1.3 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.1.1 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.0.18 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.0.17 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.0.16 test/integration/get_tracking_categories_test.rb
xero_gateway-float-2.0.15 test/integration/get_tracking_categories_test.rb
xero_gateway-2.1.0 test/integration/get_tracking_categories_test.rb
xero_gateway-n8vision-2.0.20 test/integration/get_tracking_categories_test.rb
xero_gateway-2.0.19 test/integration/get_tracking_categories_test.rb
xero_gateway-2.0.18 test/integration/get_tracking_categories_test.rb
xero_gateway-2.0.17 test/integration/get_tracking_categories_test.rb
xero_gateway-2.0.16 test/integration/get_tracking_categories_test.rb