Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 1780

Show
Ignore:
Timestamp:
05/17/07 11:21:52 (1 year ago)
Author:
nahi
Message:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/soap/test_response_as_xml.rb

    r1730 r1780  
    9090      REXML::XPath.match(doc, "//*[name()='return']")[0].text) 
    9191  end 
     92 
     93  RESPONSE_CDATA = <<__XML__.chomp 
     94<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> 
     95  <env:Body> 
     96    <gno:getHealthSummaryResponse xmlns:gno='http://some.url'> 
     97      <gno:htmlContent> 
     98        <![CDATA[<span>some html</span>]]> 
     99      </gno:htmlContent> 
     100    </gno:getHealthSummaryResponse> 
     101  </env:Body> 
     102</env:Envelope> 
     103__XML__ 
     104  def test_cdata 
     105    @client.return_response_as_xml = true 
     106    @client.test_loopback_response << RESPONSE_CDATA 
     107    xml = @client.hello(nil) 
     108    assert_equal(RESPONSE_CDATA, xml) 
     109    require 'rexml/document' 
     110    doc = REXML::Document.new(xml) 
     111    assert_equal("<span>some html</span>", 
     112      REXML::XPath.match(doc, "//*[name()='gno:htmlContent']")[0][1].value) 
     113  end 
    92114end 
    93115