diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-03 03:19:37 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-03 03:19:37 +0000 |
commit | 3d4965765cd47df7f3f9d3db4cbb117936b1c939 (patch) | |
tree | a7dcd1024112bde8716f09c1e75da22cb640d38f /actionwebservice/test/abstract_client.rb | |
parent | 94725b02bcc5e623dcbe1d73d57b2ede2c88440e (diff) | |
download | rails-3d4965765cd47df7f3f9d3db4cbb117936b1c939.tar.gz rails-3d4965765cd47df7f3f9d3db4cbb117936b1c939.tar.bz2 rails-3d4965765cd47df7f3f9d3db4cbb117936b1c939.zip |
Fix a ton of issues with AWS (yes, Kent saved it from being unbundled in 1.1) #4038 [Kent Sibilev]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3750 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test/abstract_client.rb')
-rw-r--r-- | actionwebservice/test/abstract_client.rb | 59 |
1 files changed, 53 insertions, 6 deletions
diff --git a/actionwebservice/test/abstract_client.rb b/actionwebservice/test/abstract_client.rb index 0efa1d7ec1..c5484b6b62 100644 --- a/actionwebservice/test/abstract_client.rb +++ b/actionwebservice/test/abstract_client.rb @@ -12,17 +12,44 @@ module ClientTest firstnames == other.firstnames && lastname == other.lastname end end + + class Inner < ActionWebService::Struct + member :name, :string + end + + class Outer < ActionWebService::Struct + member :name, :string + member :inner, Inner + end + + class User < ActiveRecord::Base + end + + module Accounting + class User < ActiveRecord::Base + end + end + + class WithModel < ActionWebService::Struct + member :user, User + member :users, [User] + end class API < ActionWebService::API::Base api_method :void - api_method :normal, :expects => [:int, :int], :returns => [:int] - api_method :array_return, :returns => [[Person]] - api_method :struct_pass, :expects => [[Person]], :returns => [:bool] - api_method :client_container, :returns => [:int] - api_method :named_parameters, :expects => [{:key=>:string}, {:id=>:int}] + api_method :normal, :expects => [:int, :int], :returns => [:int] + api_method :array_return, :returns => [[Person]] + api_method :struct_pass, :expects => [[Person]], :returns => [:bool] + api_method :nil_struct_return, :returns => [Person] + api_method :inner_nil, :returns => [Outer] + api_method :client_container, :returns => [:int] + api_method :named_parameters, :expects => [{:key=>:string}, {:id=>:int}] api_method :thrower + api_method :user_return, :returns => [User] + api_method :with_model_return, :returns => [WithModel] + api_method :scoped_model_return, :returns => [Accounting::User] end - + class NullLogOut def <<(*args); end end @@ -65,6 +92,14 @@ module ClientTest @value_struct_pass = @method_params true end + + def nil_struct_return + nil + end + + def inner_nil + Outer.new :name => 'outer', :inner => nil + end def client_container 50 @@ -77,6 +112,18 @@ module ClientTest def thrower raise "Hi" end + + def user_return + User.find(1) + end + + def with_model_return + WithModel.new :user => User.find(1), :users => User.find(:all) + end + + def scoped_model_return + Accounting::User.find(1) + end end class AbstractClientLet < WEBrick::HTTPServlet::AbstractServlet |