diff options
Diffstat (limited to 'actionwebservice/test/scaffolded_controller_test.rb')
-rw-r--r-- | actionwebservice/test/scaffolded_controller_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionwebservice/test/scaffolded_controller_test.rb b/actionwebservice/test/scaffolded_controller_test.rb index b41d5afe09..0aa034c3b4 100644 --- a/actionwebservice/test/scaffolded_controller_test.rb +++ b/actionwebservice/test/scaffolded_controller_test.rb @@ -18,6 +18,7 @@ end class ScaffoldedControllerTestAPI < ActionWebService::API::Base api_method :hello, :expects => [{:integer=>:int}, :string], :returns => [:bool] + api_method :hello_struct_param, :expects => [{:person => ScaffoldPerson}], :returns => [:bool] api_method :bye, :returns => [[ScaffoldPerson]] api_method :date_diff, :expects => [{:start_date => :date}, {:end_date => :date}], :returns => [:int] api_method :time_diff, :expects => [{:start_time => :time}, {:end_time => :time}], :returns => [:int] @@ -31,6 +32,10 @@ class ScaffoldedController < ActionController::Base def hello(int, string) 0 end + + def hello_struct_param(person) + 0 + end def bye [ScaffoldPerson.new(:id => 1, :name => "leon"), ScaffoldPerson.new(:id => 2, :name => "paul")] @@ -69,6 +74,11 @@ class ScaffoldedControllerTest < Test::Unit::TestCase get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'Hello' assert_rendered_file 'parameters.rhtml' end + + def test_scaffold_invoke_method_params_with_struct + get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'HelloStructParam' + assert_rendered_file 'parameters.rhtml' + end def test_scaffold_invoke_submit_hello post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Hello', :method_params => {'0' => '5', '1' => 'hello world'} |