spec/support/webmock_stanza_matching.rb
# Code to deal with the stanza
Code to deal with the stanza
Code to deal with the stanza
def body_to_stanza(body)
        if body
          params = Hash[ body.split("&").map{|c| c.split('=').map{|v| CGI.unescape(v) } } ]
          Nokogiri::XML params["stanza"]
        end
      end
def body_to_stanza ( body ) if body params = Hash [ body . split ( "&" ) . map { | c | c . split ( '=' ) . map { | v | CGI . unescape ( v ) } } ] Nokogiri :: XML params [ "stanza" ] end end
Code to deal with the stanza
Code to deal with the stanza
# Split body at '&', then split each element at '=' creating the key and value. Unescape these and turn into hash. # Pull out stanza attribute and turn into Nokogiri XML document
body
<not_specific>