Sha256: e57058526e8360b140015f41fab39da17354aed038d97971202d1e4ba93edcc6

Contents?: true

Size: 818 Bytes

Versions: 1

Compression:

Stored size: 818 Bytes

Contents

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

class CreateInvoiceTest < Test::Unit::TestCase
  include TestHelper
  
  def setup
    @gateway = XeroGateway::Gateway.new(
      :customer_key => CUSTOMER_KEY,
      :api_key => API_KEY    
    )
    
    if STUB_XERO_CALLS
      @gateway.xero_url = "DUMMY_URL"
      
      @gateway.stubs(:http_put).with {|url, body, params| url =~ /invoice$/ }.returns(get_file_as_string("invoice.xml"))          
    end
  end
  
  def test_create_invoice
    example_invoice = dummy_invoice
    
    result = @gateway.create_invoice(example_invoice)
    assert result.success?
    assert !result.request_xml.nil?
    assert !result.response_xml.nil?
    assert !result.invoice.invoice_id.nil?
    assert result.invoice.invoice_number == example_invoice.invoice_number
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tlconnor-xero_gateway-1.0.3 test/integration/create_invoice_test.rb