From 98ae24b9676fb4c28d25c13ace8d08ec741aad04 Mon Sep 17 00:00:00 2001 From: Leon Breedt Date: Wed, 9 Nov 2005 05:29:08 +0000 Subject: Fix that XML-RPC date/time values did not have well-defined behaviour (#2516, #2534). This fix has one caveat, in that we can't support pre-1970 dates from XML-RPC clients. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2945 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionwebservice/test/abstract_dispatcher.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionwebservice/test') diff --git a/actionwebservice/test/abstract_dispatcher.rb b/actionwebservice/test/abstract_dispatcher.rb index 94edb213fa..b857e4a957 100644 --- a/actionwebservice/test/abstract_dispatcher.rb +++ b/actionwebservice/test/abstract_dispatcher.rb @@ -62,6 +62,7 @@ module DispatcherTest api_method :test_utf8, :returns => [:string] api_method :hex, :expects => [:base64], :returns => [:string] api_method :unhex, :expects => [:string], :returns => [:base64] + api_method :time, :expects => [:time], :returns => [:time] end class VirtualAPI < ActionWebService::API::Base @@ -260,6 +261,10 @@ module DispatcherTest return [s].pack("H*") end + def time(t) + t + end + protected def alwaysfail(method_name, params) @before_filter_called = true @@ -295,6 +300,8 @@ module DispatcherCommonTests assert(result[1].is_a?(DispatcherTest::Person)) assert_equal("cafe", do_method_call(@direct_controller, 'Hex', "\xca\xfe")) assert_equal("\xca\xfe", do_method_call(@direct_controller, 'Unhex', "cafe")) + time = Time.gm(1998, "Feb", 02, 15, 12, 01) + assert_equal(time, do_method_call(@direct_controller, 'Time', time)) end def test_direct_entrypoint -- cgit v1.2.3