Sha256: f034938a05fe4080a04c0f1139b0d9105a6c7187a7d567f47beda5e5224de32f

Contents?: true

Size: 936 Bytes

Versions: 3

Compression:

Stored size: 936 Bytes

Contents

# encoding: UTF-8

require "spec_helper"

describe Shapewear do
  describe "usage with SOAP clients" do
    before do
      stub_request(:get, "http://services.example.com/complete/soap/wsdl") \
        .to_return :body => CompleteService.to_wsdl, :headers => {'Content-Type' => 'application/xml'}

      stub_request(:post, "http://services.example.com/complete/soap") \
        .to_return :body => lambda { |r| CompleteService.serve(r) }, :headers => {'Content-Type' => 'application/xml'}
    end

    it "should work with Savon" do
      client = Savon::Client.new 'http://services.example.com/complete/soap/wsdl'
      response = client.request :echo_in_uppercase, :xmlns => 'http://services.example.com/v1' do
        soap.body = {:text => 'uppercase text'}
      end

      puts response.inspect
      puts response.body.inspect

      response.body[:echo_in_uppercase_response][:body].should == 'UPPERCASE TEXT'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shapewear-0.0.6 spec/shapewear/savon_usage_spec.rb
shapewear-0.0.5 spec/shapewear/savon_usage_spec.rb
shapewear-0.0.4 spec/shapewear/savon_usage_spec.rb