diff --git a/lib/xero_gateway/tax_rate.rb b/lib/xero_gateway/tax_rate.rb
index dcb944b0..d9b3e70f 100644
--- a/lib/xero_gateway/tax_rate.rb
+++ b/lib/xero_gateway/tax_rate.rb
@@ -3,6 +3,7 @@ class TaxRate < BaseRecord
attributes({
"Name" => :string,
"TaxType" => :string,
+ "Status" => :string,
"CanApplyToAssets" => :boolean,
"CanApplyToEquity" => :boolean,
"CanApplyToExpenses" => :boolean,
diff --git a/test/integration/get_tax_rates_test.rb b/test/integration/get_tax_rates_test.rb
index 2e13e337..b9c0b119 100644
--- a/test/integration/get_tax_rates_test.rb
+++ b/test/integration/get_tax_rates_test.rb
@@ -2,24 +2,24 @@
class GetTaxRatesTest < 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 =~ /TaxRates$/ }.returns(get_file_as_string("tax_rates.xml"))
+
+ @gateway.stubs(:http_get).with {|client, url, params| url =~ /TaxRates$/ }.returns(get_file_as_string("tax_rates.xml"))
end
end
-
+
def test_get_tax_rates
result = @gateway.get_tax_rates
assert result.success?
assert !result.response_xml.nil?
-
+
assert result.tax_rates.size > 0
assert_equal XeroGateway::TaxRate, result.tax_rates.first.class
- assert_equal "GST on Expenses", result.tax_rates.first.name
+ assert_equal "15% GST on Expenses", result.tax_rates.first.name
end
-end
\ No newline at end of file
+end
diff --git a/test/stub_responses/tax_rates.xml b/test/stub_responses/tax_rates.xml
index 21aa04ee..cb1b2275 100644
--- a/test/stub_responses/tax_rates.xml
+++ b/test/stub_responses/tax_rates.xml
@@ -5,48 +5,61 @@
2009-10-04T03:29:54.6788414Z
- GST on Expenses
- INPUT
+ 15% GST on Expenses
+ INPUT2
true
true
true
true
false
- 12.5000
- 12.5000
+ 15.0000
+ 15.0000
+ ACTIVE
+
+
+ GST
+ 15.0000
+ false
+
+
- GST on Income
- OUTPUT
+ 15% GST on Income
+ OUTPUT2
true
true
false
true
true
- 12.5000
- 12.5000
+ 15.0000
+ 15.0000
+ ACTIVE
+
+
+ GST
+ 15.0000
+ false
+
+
- No GST
- NONE
- true
- true
- true
- true
- true
- 0.0000
- 0.0000
-
-
- Zero Rated
- ZERORATED
+ GST on Imports
+ GSTONIMPORTS
false
false
false
- false
- true
+ true
+ false
0.0000
0.0000
+ ACTIVE
+
+
+ GST
+ 0.0000
+ false
+
+
-
\ No newline at end of file
+
diff --git a/test/unit/tax_rate_test.rb b/test/unit/tax_rate_test.rb
index f242df9f..310f0d75 100644
--- a/test/unit/tax_rate_test.rb
+++ b/test/unit/tax_rate_test.rb
@@ -1,11 +1,11 @@
require File.join(File.dirname(__FILE__), '../test_helper.rb')
class TaxRateTest < Test::Unit::TestCase
-
+
# Tests that a tax rate can be converted into XML that Xero can understand, and then converted back to a tax rate
def test_build_and_parse_xml
tax_rate = create_test_tax_rate
-
+
# Generate the XML message
tax_rate_as_xml = tax_rate.to_xml
@@ -14,18 +14,19 @@ def test_build_and_parse_xml
# Build a new account from the XML
result_tax_rate = XeroGateway::TaxRate.from_xml(tax_rate_element)
-
+
# Check the account details
assert_equal tax_rate, result_tax_rate
end
-
-
+
+
private
-
+
def create_test_tax_rate
XeroGateway::TaxRate.new.tap do |tax_rate|
tax_rate.name = "GST on Expenses"
tax_rate.tax_type = "INPUT"
+ tax_rate.status = "ACTIVE"
tax_rate.can_apply_to_assets = true
tax_rate.can_apply_to_equity = true
tax_rate.can_apply_to_expenses = true
@@ -35,4 +36,4 @@ def create_test_tax_rate
tax_rate.effective_rate = 12.500
end
end
-end
\ No newline at end of file
+end