Sha256: 4a15888c442fe361362af6a773dda0c5b4ec8657c310b8df68e2ee86a2abbccc

Contents?: true

Size: 931 Bytes

Versions: 10

Compression:

Stored size: 931 Bytes

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) }

  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

10 entries across 10 versions & 1 rubygems

Version Path
soapy_cake-1.13.1 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.13.0 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.11.6 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.12.0 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.11.5 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.11.4 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.11.3 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.11.2 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.11.1 spec/lib/soapy_cake/response_spec.rb
soapy_cake-1.11.0 spec/lib/soapy_cake/response_spec.rb