I have this in a functional test: xml_http_request :delete, person_movie_path(1,1) and the error I get says the action cannot be found, as if the '':delete'' method is not being translated to the appropriate destroy action. It works fine as an Ajax call from the browser. What am I doing wrong? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Quoting itsastickup <lorrimang-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>:> > > I have this in a functional test: > > xml_http_request :delete, person_movie_path(1,1) > > and the error I get says the action cannot be found, as if the > '':delete'' method is not being translated to the appropriate destroy > action. It works fine as an Ajax call from the browser. >Probably wrong path. Check the URL generated by "person_movie_path(1,1)" against the output of "rake routes". HTH, Jeffrey --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > I have this in a functional test: > > > xml_http_request :delete, person_movie_path(1,1) > > > and the error I get says the action cannot be found, as if the > > '':delete'' method is not being translated to the appropriate destroy > > action. It works fine as an Ajax call from the browser. > > Probably wrong path. Check the URL generated by "person_movie_path(1,1)" > against the output of "rake routes".That''s what I thought but it checks out fine (I''ve practically blinded myself examining rake routes). I even test the route in the test method, and it passes. And it does work from the browser: indentical path (and :delete method). The error I get is : ActionController::UnknownAction: No action responded to /people/1/ movies/1. Actions: create, create_guid, lots more methods here, including "destroy"........ --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ok, so the solution seems to be to forget paths and do the test like this : xml_http_request :delete,''destroy'',{:id=>1,:person_id=>1} --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---