test/unit/models/invoice_test.rb in xeroizer-2.15.9 vs test/unit/models/invoice_test.rb in xeroizer-2.16.0
- old
+ new
@@ -81,10 +81,30 @@
invoice = build_valid_authorised_invoice
assert_equal(0.01, invoice.line_items.first.line_amount)
end
end
-
+
+ context "paging" do
+
+ should "have line items without downloading full invoice when paging" do
+
+ invoices = @client.Invoice.all(page: 1)
+
+ invoices.each do |invoice|
+ # This would kick off a full download without page param.
+ invoice.line_items.size
+ assert_equal(true, invoice.paged_record_downloaded?)
+
+ # This indicates that there wasn't a separate download of the individual invoice.
+ assert_equal(false, invoice.complete_record_downloaded?)
+ end
+
+
+ end
+
+ end
+
context "contact shortcuts" do
should "have valid #contact_name and #contact_id without downloading full invoice" do
invoices = @client.Invoice.all
invoices.each do |invoice|