If you're talking about testing it inside your controller specs, where you normally call
get :index
to make an HTTP request to the index action, you would instead call
xhr :get, :index
to make an XmlHttpRequest (AJAX) request to the index action using GET.