Strange web service testing problems.

Michael
2007-03-22T13:40:40Z

I seem to be having some strange problems with functionally testing web
services.

For some reason when I assert_routing of a web service called test with
a method test:

options = {:controller => "test", :action => "test"}
assert_routing "test/test", options

all is fine.

But once I invoke the method test from my test class I get a routing
error.

require File.dirname(__FILE__) + ''/../test_helper''
require ''test_controller''

class TestController; def rescue_action(e) raise e end; end

class TestControllerApiTest < Test::Unit::TestCase
  def setup
    @controller = TestController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
  end

  # passes
  def test_routing
    options = {:controller => "test", :action =>
"test"}
    assert_routing "test/test", options
  end

  # routing error
  def test_test
    invoke :test
  end
end

and here is the error:

Loaded suite test/functional/test_api_test
Started
.E
Finished in 0.062193 seconds.

  1) Error:
test_test(TestControllerApiTest):
ActionController::RoutingError: Need controller and action!

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1256:in
`generate''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/url_rewriter.rb:104:in
`rewrite_path''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/url_rewriter.rb:69:in
`rewrite''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:522:in
`url_for''

/Users/mbrio/Documents/Source/livegames-network/config/../app/controllers/application.rb:93:in
`remember_location''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:456:in
`send''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:456:in
`call''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:450:in
`call''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
`call_filter''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
`call_filter''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:449:in
`call''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
`call_filter''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
`perform_action_without_benchmark''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue''
    /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
`perform_action''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
`send''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
`process_without_filters''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in
`process_without_session_management_support''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
`process_without_test''

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/test_process.rb:15:in
`process''

/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.2.3/lib/action_web_service/test_invoke.rb:10:in
`invoke''
    test/functional/test_api_test.rb:19:in `test_test''

Any help would be greatly appreciated.

--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---