I recently had a look at the awesome Blue Ridge Javascript testing framework to test javascript on my rails app. But i was wondering if anyone knew how to test the javascript view files in rails?
The Blue Ridge framework(as far as i could understand) lets you test only the javascript files. But I wanted to test my "js.erb" files which also manipulate the DOM.
Anyone has any insights?
What I do is to use a slightly modified version of these two functions I googled, save_fixture and html_for, to save view fixtures, which I load into the tests. To test ajax responses, you can save a response fixture and then load both the view and response fixtures into your test.
I don't use Blue Ridge, I use jasmine/jasmine-jquery. So I don't know if it has a loadFixtures() feature, which loads a file for test, but that's the pattern.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With