How to use and test an AJAX request in Rails