Check this out

I stupidly didn't see how the testing done in https://github.com/rails/jquery-ujs, so I copy solution from activeadmin.

Simple how it works: when we run rspec - 

* it checks if testing rails app exist, if no - runs `rake setup`
* `rake setup` generates new rails app in `spec/rails/rails-#{version}` folder
* then make a symlink `spec/support/templates/app => <rails>/app` (to new generated application)
* then run specs with it like usual rails application.

For development purpose we can run `rake setup` and `rake test_server`, it will start server (same as `rails server`)

----

I also implemented few things of rails-ujs, I think if we bind one event on document object and then checking e.target on each click - it will initialize faster and works well with dynamic content, also no need to implement domready. But I think not all features are easy to do with global event. So I also found short cross-browser implementation of `$(document).ready()`.