Sha256: f6e5493289271badd0fed397d4c5a4c1d61d63eb6c04d2d5660238d7e6339ddf

Contents?: true

Size: 1 KB

Versions: 7

Compression:

Stored size: 1 KB

Contents

require 'test_helper'

class RepeatingInvoiceTest < Test::Unit::TestCase
  include TestHelper

  def setup
    @client = Xeroizer::PublicApplication.new(CONSUMER_KEY, CONSUMER_SECRET)
    mock_api('RepeatingInvoices')
  end

  context "GET" do

    should "have return repeating invoices" do
      repeating_invoices = @client.RepeatingInvoice.all(page: 1)

      assert_equal 1, repeating_invoices.size

      repeating_invoice = repeating_invoices.first

      assert_equal "PowerDirect", repeating_invoice.contact_name
      assert_equal BigDecimal.new(90), repeating_invoice.total
      assert_equal true, repeating_invoice.accounts_payable?

      schedule = repeating_invoice.schedule

      assert_equal 1, schedule.period
      assert_equal 'MONTHLY', schedule.unit
      assert_equal 10, schedule.due_date
      assert_equal 'OFFOLLOWINGMONTH', schedule.due_date_type
      assert_equal Date.new(2013,1,21), schedule.start_date
      assert_equal Date.new(2014,3,23), schedule.next_scheduled_date
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
xeroizer-2.18.1 test/unit/models/repeating_invoice_test.rb
xeroizer-2.17.1 test/unit/models/repeating_invoice_test.rb
xeroizer-2.16.5 test/unit/models/repeating_invoice_test.rb
xeroizer-2.16.4 test/unit/models/repeating_invoice_test.rb
xeroizer-2.16.3 test/unit/models/repeating_invoice_test.rb
xeroizer-2.16.1 test/unit/models/repeating_invoice_test.rb
xeroizer-2.16.0 test/unit/models/repeating_invoice_test.rb