Sha256: 0ee92dc5db6dbfae2e92895410c3b0b89f1b707487a3d9e0e1fa1e1936a498e8

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

RSpec.describe SoapyCake::Response do
  let(:xml) do
    <<-EOD
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
        <soap:Body>
          <SomeResponse>
            <SomeResult>
              <success>true</success>
              <row_count>2</row_count>
              <somes>
                <some>
                  <id>123</id>
                </some>
                <some>
                  <id>312</id>
                </some>
              </somes>
            </SomeResult>
          </SomeResponse>
        </soap:Body>
      </soap:Envelope>
    EOD
  end

  subject { described_class.new(xml.strip, false, 0) }

  it 'returns an enumerator' do
    expect(subject.to_enum).to be_a(Enumerator)
  end

  it 'parses the CAKE XML structure properly' do
    expect(subject.to_enum.to_a).to eq([
                                         { id: '123' },
                                         { id: '312' }
                                       ])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
soapy_cake-1.21.0 spec/lib/soapy_cake/response_spec.rb