Send XHR requests in Rspec controller tests

You can send xhr requests in your rspec tests by using xhr instead of get or post followed by a symbol of the submission method like this: xhr :get, :index, :id = 10

Jonathan Knapp About 12 years ago