Skip to content

Commit

Permalink
possible fix for issue savonrb#29 (default to utf to wsse auth)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiii committed Jan 27, 2010
1 parent 3e3f0fc commit c73f76e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/savon.rb
Expand Up @@ -4,7 +4,7 @@ module Savon
SOAPVersions = [1, 2]

# SOAP xs:dateTime format.
SOAPDateTimeFormat = "%Y-%m-%dT%H:%M:%S"
SOAPDateTimeFormat = "%Y-%m-%dT%H:%M:%SZ"

# SOAP xs:dateTime Regexp.
SOAPDateTimeRegexp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/
Expand Down
2 changes: 1 addition & 1 deletion spec/savon/core_ext/datetime_spec.rb
Expand Up @@ -5,7 +5,7 @@
describe "to_soap_value" do
it "returns an xs:dateTime compliant String" do
DateTime.new(2012, 03, 22, 16, 22, 33).to_soap_value.
should == "2012-03-22T16:22:33"
should == "2012-03-22T16:22:33Z"
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/savon/core_ext/hash_spec.rb
Expand Up @@ -53,7 +53,7 @@

it "converts DateTime objects to xs:dateTime compliant Strings" do
{ :before => DateTime.new(2012, 03, 22, 16, 22, 33) }.to_soap_xml.
should == "<before>" << "2012-03-22T16:22:33" << "</before>"
should == "<before>" << "2012-03-22T16:22:33Z" << "</before>"
end

it "converts Objects responding to to_datetime to xs:dateTime compliant Strings" do
Expand All @@ -63,7 +63,7 @@ def singleton.to_datetime
end

{ :before => singleton }.to_soap_xml.
should == "<before>" << "2012-03-22T16:22:33" << "</before>"
should == "<before>" << "2012-03-22T16:22:33Z" << "</before>"
end

it "calls to_s on Strings even if they respond to to_datetime" do
Expand Down
2 changes: 1 addition & 1 deletion spec/savon/core_ext/object_spec.rb
Expand Up @@ -29,7 +29,7 @@ def singleton.to_datetime
DateTime.new(2012, 03, 22, 16, 22, 33)
end

singleton.to_soap_value.should == "2012-03-22T16:22:33"
singleton.to_soap_value.should == "2012-03-22T16:22:33Z"
end

it "calls to_s unless the Object responds to to_datetime" do
Expand Down
2 changes: 1 addition & 1 deletion spec/savon/savon_spec.rb
Expand Up @@ -12,7 +12,7 @@
Savon::SOAPDateTimeFormat.should_not be_empty

DateTime.new(2012, 03, 22, 16, 22, 33).strftime(Savon::SOAPDateTimeFormat).
should == "2012-03-22T16:22:33"
should == "2012-03-22T16:22:33Z"
end

it "contains a Regexp matching the xs:dateTime format" do
Expand Down

0 comments on commit c73f76e

Please sign in to comment.