Sha256: 994b06ae94fef3652dfdbd62c64bec1daeb5100ca0bb4c5a5b215c6451358b93

Contents?: true

Size: 1.33 KB

Versions: 18

Compression:

Stored size: 1.33 KB

Contents

RSpec.describe Epics::STA do
  let(:client) { Epics::Client.new( File.open(File.join( File.dirname(__FILE__), '..', 'fixtures', 'SIZBN001.key')), 'secret' , 'https://194.180.18.30/ebicsweb/ebicsweb', 'SIZBN001', 'EBIX', 'EBICS') }

  context 'with date range' do
    subject(:order) { described_class.new(client, "2014-09-01", "2014-09-30") }

    describe '#to_xml' do
      specify { expect(order.to_xml).to be_a_valid_ebics_doc }

      it 'does includes a date range as standard order parameter' do
        expect(order.to_xml).to include('<StandardOrderParams><DateRange><Start>2014-09-01</Start><End>2014-09-30</End></DateRange></StandardOrderParams>')
      end
    end

    describe '#to_receipt_xml' do
      before { order.transaction_id = SecureRandom.hex(16) }

      specify { expect(order.to_receipt_xml).to be_a_valid_ebics_doc }
    end
  end

  context 'without date range' do
    subject(:order) { described_class.new(client) }

    describe '#to_xml' do
      specify { expect(order.to_xml).to be_a_valid_ebics_doc }

      it 'does not include a standard order parameter' do
        expect(order.to_xml).to include('<StandardOrderParams/>')
      end
    end

    describe '#to_receipt_xml' do
      before { order.transaction_id = SecureRandom.hex(16) }

      specify { expect(order.to_receipt_xml).to be_a_valid_ebics_doc }
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
epics-2.4.0 spec/orders/sta_spec.rb
epics-2.3.0 spec/orders/sta_spec.rb
epics-2.2.0 spec/orders/sta_spec.rb
epics-2.1.2 spec/orders/sta_spec.rb
epics-2.1.1 spec/orders/sta_spec.rb
epics-2.1.0 spec/orders/sta_spec.rb
epics-2.0.0 spec/orders/sta_spec.rb
epics-1.8.1 spec/orders/sta_spec.rb
epics-1.8.0 spec/orders/sta_spec.rb
epics-1.7.2 spec/orders/sta_spec.rb
epics-1.7.1 spec/orders/sta_spec.rb
epics-1.7.0 spec/orders/sta_spec.rb
epics-1.6.0 spec/orders/sta_spec.rb
epics-1.5.2 spec/orders/sta_spec.rb
epics-1.5.1 spec/orders/sta_spec.rb
epics-1.5.0 spec/orders/sta_spec.rb
epics-1.4.1 spec/orders/sta_spec.rb
epics-1.4.0 spec/orders/sta_spec.rb