Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing AJAX-intensive Rails application with RSpec

I'm writing a very AJAX-intensive application using Rails 3.0.4, and testing it with RSpec. Most of my controller actions just respond to a "js" format, ie:

respond_to do |format|
  f.js
end

and other respond to json. I found how to JSON output, but I'm not really sure how to test the javascript output from the other actions.

Any ideas? Thanks!

like image 373
Ian Avatar asked Oct 12 '22 11:10

Ian


1 Answers

I'd checkout Selenium to handle testing of javascript/ajax functionality of your website.

Checkout this popular slideshow on testing Rails apps with Selenium.

like image 121
Mike Lewis Avatar answered Oct 14 '22 10:10

Mike Lewis