Sha256: 3761b939b639032b4a079bbc20d72d815f934b9ca13a07f98e3b5d3f06ba8a64
Contents?: true
Size: 1.52 KB
Versions: 1
Compression:
Stored size: 1.52 KB
Contents
require 'spec_helper' describe Moysklad::Entities::CustomerOrder do context 'generate' do subject { p= Moysklad::Entities::CustomerOrderPosition.new p.vat = 18 p.basePrice = Moysklad::Entities::Price.new p.basePrice.sum = 123 p.reserve = true co = Moysklad::Entities::CustomerOrder.new co.sum = Moysklad::Entities::Price.new co.sum.sum = 456 co.description = 'Описание' co.customerOrderPosition = p co } it 'state' do stub_rest 'Workflow', :list, 0 allow(subject).to receive(:stateUuid).and_return 'f16b0ca9-ff79-11e4-90a2-8ecb0000fdf9' expect(subject.state universe).to be_a Moysklad::Entities::WorkflowState end it 'to_xml' do expect(subject.to_xml).to be_a String end it 'to_s' do expect(subject.to_s).to be_a String end it 'include xml' do expect(subject.to_xml).to include '<?xml version="1.0" encoding="utf-8"?>' end it 'include customerOrder' do expect(subject.to_xml).to include "<customerOrder" end it 'include customerOrderPosition' do expect(subject.to_xml).to include "<customerOrderPosition" end end context 'parse' do subject { Moysklad::Entities::CustomerOrder.parse File.read './spec/fixtures/customer_order.xml' } it 'include customerOrder' do expect(subject.to_xml).to include "<customerOrder" end it 'include customerOrderPosition' do expect(subject.to_xml).to include "<customerOrderPosition" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
moysklad-0.3.0 | spec/lib/moysklad/entities/customer_order_spec.rb |