Hello, I''ve just recently discovered the wonderful world of routes. But I can''t get my test to work when using them. An example: I have a ClientController which has an index action. I want to access the action like this: http://mysite/admin/clients For this, I have created a route: map.connect ''admin/ clients'', :controller => ''client'', :action => ''index'' In my test I have: get "admin/clients" [ ... some lines of assertions because you need to be logged in ... ] get "admin/clients" When my test "hits" the admin/clients url the second time, my test fails with: ActionController::UnknownAction: No action responded to /admin/clients Why is that? And what is it about routes I have missed? Greetings, Gitte Wange --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gitte Wange wrote:> Hello, > > I''ve just recently discovered the wonderful world of routes. But I > can''t get my test to work when using them. > > When my test "hits" the admin/clients url the second time, my test > fails with: > ActionController::UnknownAction: No action responded to /admin/clients > > Why is that? And what is it about routes I have missed? > > Greetings, > Gitte WangeMake sure you''re in an integration test, and not a functional test. Functional test only support direct calling of action with the get and post methods. Integration tests can use a string that gets routed. -- 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 -~----------~----~----~----~------~----~------~--~---
Gitte Wange
2006-Nov-08 11:03 UTC
Re: Integration test (Was: [Rails] Re: Testing /using routes)
On 08/11/2006, at 9.05, Alex Wayne wrote:> > Gitte Wange wrote: >> Hello, >> >> I''ve just recently discovered the wonderful world of routes. But I >> can''t get my test to work when using them. >> >> When my test "hits" the admin/clients url the second time, my test >> fails with: >> ActionController::UnknownAction: No action responded to /admin/ >> clients >> >> Why is that? And what is it about routes I have missed? >> >> Greetings, >> Gitte Wange > > Make sure you''re in an integration test, and not a functional test. > Functional test only support direct calling of action with the get and > post methods. Integration tests can use a string that gets routed.I have not yet looked at integration tests. How does they work and are there any docs on these somewhere? Greetings, Gitte Wange --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---