diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-23 16:07:03 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-23 16:07:03 +0000 |
commit | 4a968d464b32f83856761c60135e29326c6245fc (patch) | |
tree | ae7b4ee3f4a95555699a0d5197cc97d895f6123a /actionwebservice/test | |
parent | ed10f873a17dacb60f503102a023233b9589f598 (diff) | |
download | rails-4a968d464b32f83856761c60135e29326c6245fc.tar.gz rails-4a968d464b32f83856761c60135e29326c6245fc.tar.bz2 rails-4a968d464b32f83856761c60135e29326c6245fc.zip |
Fixed that AWS Scaffold Fails with Struct as a Parameter (closes #4363) [joe@mjg2.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test')
-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'} |