Sha256: 281e07f41f05b9542653fef5671d06d607b2d67d03f88e47c10c11bced288b91

Contents?: true

Size: 1.1 KB

Versions: 39

Compression:

Stored size: 1.1 KB

Contents

require 'test_helper'

class CreditNoteTest < Test::Unit::TestCase
  include TestHelper
  
  def setup
    @client = Xeroizer::PublicApplication.new(CONSUMER_KEY, CONSUMER_SECRET)    
    mock_api("CreditNotes")
    @credit_note = @client.CreditNote.first
  end
  
  context "credit note totals" do
    
    should "raise error when trying to set totals directly" do
      assert_raises Xeroizer::SettingTotalDirectlyNotSupported do
        @credit_note.sub_total = 500.0
      end
      assert_raises Xeroizer::SettingTotalDirectlyNotSupported do
        @credit_note.total_tax = 50.0
      end
      assert_raises Xeroizer::SettingTotalDirectlyNotSupported do
        @credit_note.total = 550.0
      end
    end
        
    should "large-scale testing from API XML" do
      credit_notes = @client.CreditNote.all
      credit_notes.each do | credit_note |
        assert_equal(credit_note.attributes[:sub_total], credit_note.sub_total)
        assert_equal(credit_note.attributes[:total_tax], credit_note.total_tax)
        assert_equal(credit_note.attributes[:total], credit_note.total)
      end
    end
    
  end
  
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
xeroizer-2.20.0 test/unit/models/credit_note_test.rb
xeroizer-2.19.0 test/unit/models/credit_note_test.rb
xeroizer-2.18.1 test/unit/models/credit_note_test.rb
xeroizer-2.17.1 test/unit/models/credit_note_test.rb
xeroizer-2.16.5 test/unit/models/credit_note_test.rb
xeroizer-2.16.4 test/unit/models/credit_note_test.rb
xeroizer-2.16.3 test/unit/models/credit_note_test.rb
xeroizer-2.16.1 test/unit/models/credit_note_test.rb
xeroizer-2.16.0 test/unit/models/credit_note_test.rb
xeroizer-2.15.9 test/unit/models/credit_note_test.rb
xeroizer-2.15.8 test/unit/models/credit_note_test.rb
xeroizer-2.15.7 test/unit/models/credit_note_test.rb
xeroizer-2.15.6 test/unit/models/credit_note_test.rb
xeroizer-2.15.5 test/unit/models/credit_note_test.rb
xeroizer-float-2.15.3.13 test/unit/models/credit_note_test.rb
xeroizer-float-2.15.3.12 test/unit/models/credit_note_test.rb
xeroizer-float-2.15.3.11 test/unit/models/credit_note_test.rb
xeroizer-float-2.15.3.10 test/unit/models/credit_note_test.rb
xeroizer-float-2.15.3.9 test/unit/models/credit_note_test.rb
xeroizer-float-2.15.3.8 test/unit/models/credit_note_test.rb