aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/test
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2006-06-27 19:41:14 +0000
committerMarcel Molina <marcel@vernix.org>2006-06-27 19:41:14 +0000
commit68a320ad2047c483b4b07cd51c5043cdef562adb (patch)
tree7a783a08c9c0324c98f10f3cbf8b87f4d185e76f /actionwebservice/test
parent236c7325df4ca2783c92dffc0f0b9592f822d95a (diff)
downloadrails-68a320ad2047c483b4b07cd51c5043cdef562adb.tar.gz
rails-68a320ad2047c483b4b07cd51c5043cdef562adb.tar.bz2
rails-68a320ad2047c483b4b07cd51c5043cdef562adb.zip
Fix invoke_layered since api_method didn't declare :expects. Closes #4720. [Kevin Ballard <kevin@sb.org>, Kent Sibilev]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4497 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/test')
-rw-r--r--actionwebservice/test/test_invoke_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionwebservice/test/test_invoke_test.rb b/actionwebservice/test/test_invoke_test.rb
index 46f9ddb2d2..72ebc71925 100644
--- a/actionwebservice/test/test_invoke_test.rb
+++ b/actionwebservice/test/test_invoke_test.rb
@@ -2,6 +2,7 @@ require File.dirname(__FILE__) + '/abstract_unit'
require 'action_web_service/test_invoke'
class TestInvokeAPI < ActionWebService::API::Base
+ api_method :null
api_method :add, :expects => [:int, :int], :returns => [:int]
end
@@ -14,6 +15,9 @@ class TestInvokeService < ActionWebService::Base
@invoked = true
a + b
end
+
+ def null
+ end
end
class TestController < ActionController::Base
@@ -29,6 +33,9 @@ class TestInvokeDirectController < TestController
@invoked = true
@method_params[0] + @method_params[1]
end
+
+ def null
+ end
end
class TestInvokeDelegatedController < TestController
@@ -97,4 +104,9 @@ class TestInvokeTest < Test::Unit::TestCase
assert_raise(ArgumentError) { invoke :add, 1 }
end
+ def test_with_no_parameters_declared
+ @controller = TestInvokeDirectController.new
+ assert_nil invoke(:null)
+ end
+
end