savon 2.8.0 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7adbc53fe80bb807f76d542112ff55db6da480e9
4
- data.tar.gz: 0536349c41007db20291ca8e7dad28c125666066
3
+ metadata.gz: 379ca76fcbfd623cc2e02ff387233fd764e50fdf
4
+ data.tar.gz: 2a2ff2a7c89ac4d5da0d62196388b49514bc3eeb
5
5
  SHA512:
6
- metadata.gz: 741e08c1b5fba53b3588c52e454e50bfb14eb73c6ed463fc994468e62e77720dc574fabd2506fc51f4cb1f192fd7774bc63574467579e562eba4e8a4f95eb712
7
- data.tar.gz: b4c4144f0714a3f49bfcae8e304d7031bc46d396b0ee45334a84a73ebb06dcbf5036468bf784c95eb6090456ecf933e89c71c29c8a3556b3732ec9200ef7214f
6
+ metadata.gz: b5a27414b2371f54d7d7ccc7c92ca360bba02bee470c6274af9491aae939229ad15e4997415818d3b2947503bcdc79c1d6c7fc3860019195ef5e85589ab1edd1
7
+ data.tar.gz: 55804add86b33a9bddac6cdf6383bc7f89025eaf4fdcee9d43ccd0aaa21295a39932b98eae75b111c86882c26e916eea8693aea1e7f7015cb22c815b8ba13374
data/.travis.yml CHANGED
@@ -2,10 +2,8 @@
2
2
  language: "ruby"
3
3
  script: "bundle exec rake --trace"
4
4
  rvm:
5
- - 1.9.3
6
5
  - 2.0
7
6
  - 2.1
8
7
  - jruby
9
- - rbx-2
10
8
  notifications:
11
9
  irc: "irc.freenode.org#savon"
data/README.md CHANGED
@@ -22,7 +22,7 @@ $ gem install savon
22
22
  or add it to your Gemfile like this:
23
23
 
24
24
  ```
25
- gem 'savon', '~> 2.3.0'
25
+ gem 'savon', '~> 2.8.0'
26
26
  ```
27
27
 
28
28
  ## Usage example
data/lib/savon/header.rb CHANGED
@@ -61,7 +61,12 @@ module Savon
61
61
  convert_to_xml({
62
62
  'wsa:Action' => @locals[:soap_action],
63
63
  'wsa:To' => @globals[:endpoint],
64
- 'wsa:MessageID' => "urn:uuid:#{UUID.new.generate}"
64
+ 'wsa:MessageID' => "urn:uuid:#{UUID.new.generate}",
65
+ attributes!: {
66
+ 'wsa:MessageID' => {
67
+ "xmlns:wsa" => "http://schemas.xmlsoap.org/ws/2004/08/addressing"
68
+ }
69
+ }
65
70
  })
66
71
  end
67
72
 
data/lib/savon/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Savon
2
- VERSION = '2.8.0'
2
+ VERSION = '2.8.1'
3
3
  end
@@ -11,29 +11,59 @@ describe Savon::Message do
11
11
  @server.stop
12
12
  end
13
13
 
14
- context "with a qualified message" do
15
- it "converts request Hash keys for which there is not namespace" do
16
- client = Savon.client(
17
- :endpoint => @server.url(:repeat),
18
- :namespace => 'http://example.com',
19
- :log => false,
14
+ let(:client_config) {
15
+ {
16
+ :endpoint => @server.url(:repeat),
17
+ :namespace => 'http://example.com',
18
+ :log => false,
19
+
20
+ :element_form_default => :qualified,
21
+ :convert_request_keys_to => :camelcase,
20
22
 
21
- :element_form_default => :qualified,
22
- :convert_request_keys_to => :camelcase,
23
+ :convert_response_tags_to => nil
24
+ }
25
+ }
23
26
 
24
- :convert_response_tags_to => nil
25
- )
27
+ let(:client) { Savon.client(client_config) }
26
28
 
27
- message = {
29
+ context "with a qualified message" do
30
+ let(:message) {
31
+ {
28
32
  :email_count => 3,
29
33
  :user_name => 'josh',
30
34
  :order! => [:user_name, :email_count]
31
35
  }
36
+ }
32
37
 
38
+ let(:converted_keys) {
39
+ '<wsdl:UserName>josh</wsdl:UserName><wsdl:EmailCount>3</wsdl:EmailCount>'
40
+ }
41
+ it "converts request Hash keys for which there is not namespace" do
33
42
  response = client.call(:something, :message => message)
34
- body = response.hash['Envelope']['Body']
43
+ expect(response.xml).to include(converted_keys)
44
+ end
45
+ end
46
+
47
+ context 'use_wsa_headers' do
48
+ let(:client_config) { super().merge(use_wsa_headers: true) }
35
49
 
36
- expect(response.xml).to include('<wsdl:UserName>josh</wsdl:UserName><wsdl:EmailCount>3</wsdl:EmailCount>')
50
+ context 'headers' do
51
+ [ 'wsa:Action', 'wsa:To', 'wsa:MessageID' ].each do |header|
52
+ it "should include #{header} header" do
53
+ response = client.call(:something, message: {})
54
+ expect(response.xml).to include(header)
55
+ end
56
+ end
57
+ end
58
+
59
+ context 'wsa:MessageID' do
60
+ let(:message_id_tag) {
61
+ '<wsa:MessageID xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">'
62
+ }
63
+ it 'should include xmlns:wsa attribute' do
64
+ response = client.call(:something, message: {})
65
+ expect(response.xml).to include(message_id_tag)
66
+ end
37
67
  end
38
68
  end
39
69
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-12 00:00:00.000000000 Z
11
+ date: 2015-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nori