test/unit/models/invoice_test.rb in xeroizer-2.15.3 vs test/unit/models/invoice_test.rb in xeroizer-2.15.5
- old
+ new
@@ -39,22 +39,10 @@
end
context "invoice totals" do
- should "raise error when trying to set totals directly" do
- assert_raises Xeroizer::SettingTotalDirectlyNotSupported do
- @invoice.sub_total = 100.0
- end
- assert_raises Xeroizer::SettingTotalDirectlyNotSupported do
- @invoice.total_tax = 100.0
- end
- assert_raises Xeroizer::SettingTotalDirectlyNotSupported do
- @invoice.total = 100.0
- end
- end
-
should "large-scale testing from API XML" do
invoices = @client.Invoice.all
invoices.each do | invoice |
assert_equal(invoice.attributes[:sub_total], invoice.sub_total)
assert_equal(invoice.attributes[:total_tax], invoice.total_tax)
@@ -106,7 +94,20 @@
assert_equal(false, invoice.complete_record_downloaded?)
end
end
end
+
+ context "updated date" do
+ should "get the updated date as utc" do
+ invoices = @client.Invoice.all
+
+ assert_equal(Time.parse("2008-9-16T10:28:51.5Z"), invoices[0].updated_date_utc)
+
+ invoices.each do |invoice|
+ assert invoice.updated_date_utc.utc?, "updated_date_utc should be utc"
+ end
+ end
+ end
+
end