Sha256: 43b079bca3bbf9945e598ff7a46be211f7984b93f34d18b9dd7337924323266f

Contents?: true

Size: 943 Bytes

Versions: 7

Compression:

Stored size: 943 Bytes

Contents

require 'test_helper'

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

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

  context "sales_tax_basis_validations" do
    should "allow nil sales tax bases and countries" do
      organisation = @client.Organisation.build

      assert(organisation.valid?)
    end

    it 'should validate sales_tax_basis' do
      organisation = @client.Organisation.build(:sales_tax_basis => "Cat")

      assert(!organisation.valid?)

      organisation.sales_tax_basis = "ACCRUALS"

      assert(organisation.valid?)
    end

    it 'should validate sales_tax_basis for a specific country like NZ' do
      organisation = @client.Organisation.build(:sales_tax_basis => "FLATRATECASH", :country_code => "NZ")

      assert(!organisation.valid?)

      organisation.sales_tax_basis = "NONE"

      assert(organisation.valid?)
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

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