Sha256: 9ec0325ec43193e4e7f2234118399015b3c50611b39788f7c6e7acb3bb62a31c

Contents?: true

Size: 1.09 KB

Versions: 10

Compression:

Stored size: 1.09 KB

Contents

require File.join(File.dirname(__FILE__), "..", "helper")

class SoapEnvelopeTest < Test::Unit::TestCase

  context "Calling soap_envelope" do
    setup { ApricotEatsGorilla.sort_keys = true }

    context "without parameter and block" do
      should "returns a SOAP envelope without body content" do
        expected = '<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">' <<
          '<env:Body></env:Body></env:Envelope>'

        result = ApricotEatsGorilla.soap_envelope
        assert_equal expected, result
      end
    end
    
    context "with a Hash containing a custom namespace and a block" do
      should "returns a SOAP envelope with custom namespace and body content" do
        expected = '<env:Envelope ' <<
          'xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" ' <<
          'xmlns:wsdl="http://example.com">' <<
          '<env:Body><id>123</id></env:Body></env:Envelope>'

        result = ApricotEatsGorilla.soap_envelope "wsdl" => "http://example.com" do
          "<id>123</id>"
        end
        assert_equal expected, result
      end
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
smacks-apricoteatsgorilla-0.3.6 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.3.61 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.3.7 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.3.8 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.3.9 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.3.91 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.4.0 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.4.1 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.4.2 test/apricoteatsgorilla/soap_envelope_test.rb
smacks-apricoteatsgorilla-0.4.3 test/apricoteatsgorilla/soap_envelope_test.rb