Autotesting JavaScript in Rails
Written by on January 4th, 2008 in Ajax News.
Dr Nic has written a tutorial on testing JavaScript in Rails using a new javascript_test plugin.
Once you ruby script/plugin install javascript_test you can ruby script/generate javascript_test maths. Then you can write a test a la:
JAVASCRIPT:
-
-
testTruth: function() { with(this) {
-
assert(true);
-
}}
-
You can go further though with the autotest watching over files, and Nic shows some TDD in action.
Source: Ajaxian
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/211095933/autotesting-javascript-in-rails
