Sha256: d982987c037999addec177edbdfb583beb4d088ee0b037752ff70b0ff39c04ed

Contents?: true

Size: 764 Bytes

Versions: 10

Compression:

Stored size: 764 Bytes

Contents

require 'spec_helper'
require 'quickbooks'

describe Qbxml do
  context 'backwards compatibility with the quickbooks_api gem' do

    let(:qb_old) { Quickbooks::API[:qb] }
    let(:qb_new) { Qbxml.new(:qb) }

    it 'should produce the same results when parsing qbxml/hash data' do
      (requests + responses).each do |data|
        old_parse = qb_old.qbxml_to_hash(data, true) 

        new_parse1 = qb_new.from_qbxml(data)
        new_parse1.should == { 'qbxml' => old_parse }

        # XML is a pain to compare so we can compare the parsed hash resulting
        # from the generated XML instead.
        #
        new_parse2 =  qb_new.from_qbxml(qb_new.to_qbxml(new_parse1))
        new_parse2.should == { 'qbxml' => old_parse }
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
mrglass-qbxml-1.0.0 spec/backwards_compatibility.rb
qbxml-0.4.0 spec/backwards_compatibility.rb
qbxml-0.3.0 spec/backwards_compatibility.rb
qbxml-0.2.0 spec/backwards_compatibility.rb
qbxml-0.1.6 spec/backwards_compatibility.rb
qbxml-dtd6-1.0.3 spec/backwards_compatibility.rb
qbxml-dtd6-1.0.2 spec/backwards_compatibility.rb
qbxml-0.1.5 spec/backwards_compatibility.rb
qbxml-0.1.4 spec/backwards_compatibility.rb
qbxml-0.1.3 spec/backwards_compatibility.rb