# Newbie testing: xml\_http\_request and route, route not recognised

**URL:** <https://www.ruby-forum.com/t/newbie-testing-xml-http-request-and-route-route-not-recognised/158791>\
**Category:** Rails\
**Created:** [January 28, 2009, 12:44am UTC](https://www.ruby-forum.com/t/newbie-testing-xml-http-request-and-route-route-not-recognised/158791 "2009-01-28T00:44:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsastickup](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7feea3/32.png) [@itsastickup](https://www.ruby-forum.com/u/itsastickup)\
**Post date:** [January 28, 2009, 12:44am UTC](https://www.ruby-forum.com/t/newbie-testing-xml-http-request-and-route-route-not-recognised/158791/1 "2009-01-28T00:44:53Z")

</div>

In my view the generated html has this, and it works just fine:

\<a href=“/people/2/movies/19” method=“delete” onclick=“if (confirm  
(‘Delete “Highlander”. Are you sure?’)) { new Ajax.Request(‘/people/2/  
movies/19’, {asynchronous:true, evalScripts:true, method:‘delete’,  
parameters:‘authenticity\_token=’ + encodeURIComponent  
(‘3a75bac4c7d8a5a2470788e7c428d2b76928aa3c’)}); }; return  
false;”\>delete

So in my functional tests I tried the following and it tells me the  
action isn’t recognized, as if it isn’t translating the :delete method  
to the destroy action in the controller :

xml\_http\_request :delete, person\_movie\_path(movies  
(:one).person\_id,movies(:one).id)

“rake test” gets me :

test\_delete(MoviesControllerTest):  
ActionController::UnknownAction: No action responded to /people/  
520095529/movies/953125641. Actions: create, create\_guid  
, delete\_more\_than, destroy, edit, edit\_person\_movie\_path, exception,  
exception=, index, log\_for\_stats, log\_login, new,  
redirect\_loop\_or\_default, referrer\_url, rescue\_action\_without\_handler,  
save\_referrer\_to\_cookie, store\_loop, and update

I’m a bit perplexed. googling didn’t get me any clues. The route is  
correct, I think. See this pastie [http://www.pastie.org/372719](http://www.pastie.org/372719) if you  
think my movie routes may be up the spout.

Any ideas? (I hope so)
