aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/test/abstract_dispatcher.rb
diff options
context:
space:
mode:
authorLeon Breedt <bitserf@gmail.com>2005-05-07 22:57:08 +0000
committerLeon Breedt <bitserf@gmail.com>2005-05-07 22:57:08 +0000
commit47a7084b94b8cd0dfc43e0b8f1775eef31c5170d (patch)
treede59c26718ad183b86693f3d45f50380b6510879 /actionwebservice/test/abstract_dispatcher.rb
parent8a41ea4588f87e963a467305a6757381b6387ca5 (diff)
downloadrails-47a7084b94b8cd0dfc43e0b8f1775eef31c5170d.tar.gz
rails-47a7084b94b8cd0dfc43e0b8f1775eef31c5170d.tar.bz2
rails-47a7084b94b8cd0dfc43e0b8f1775eef31c5170d.zip
add base64 signature type (thanks, Shugo Maeda!)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1293 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test/abstract_dispatcher.rb')
-rw-r--r--actionwebservice/test/abstract_dispatcher.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionwebservice/test/abstract_dispatcher.rb b/actionwebservice/test/abstract_dispatcher.rb
index 7d02943d0a..78243ee497 100644
--- a/actionwebservice/test/abstract_dispatcher.rb
+++ b/actionwebservice/test/abstract_dispatcher.rb
@@ -56,6 +56,8 @@ module DispatcherTest
api_method :hash_struct_return, :returns => [[Person]]
api_method :thrower
api_method :void
+ api_method :hex, :expects => [:base64], :returns => [:string]
+ api_method :unhex, :expects => [:string], :returns => [:base64]
end
class VirtualAPI < ActionWebService::API::Base
@@ -216,6 +218,14 @@ module DispatcherTest
@void_called = @method_params
end
+ def hex(s)
+ return s.unpack("H*")[0]
+ end
+
+ def unhex(s)
+ return [s].pack("H*")
+ end
+
protected
def alwaysfail
@before_filter_called = true
@@ -248,6 +258,8 @@ module DispatcherCommonTests
result = do_method_call(@direct_controller, 'BaseStructReturn')
assert(result[0].is_a?(DispatcherTest::Person))
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"))
end
def test_direct_entrypoint