Friday, January 4th, 2008

Autotesting JavaScript in Rails

Category: Articles, Testing

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

  1. testTruth: function() { with(this) {
  2.   assert(true);
  3. }}

You can go further though with the autotest watching over files, and Nic shows some TDD in action.

Posted by Dion Almaer at 7:56 am
1 Comment

+++--
3.4 rating from 13 votes

1 Comment »

Comments feed TrackBack URI

And of course, if you like rspec and BDD more than xUnit and TDD, you can use js-spec, in which I’ve been working for a while now :)

Comment by foca — January 4, 2008

Leave a comment

You must be logged in to post a comment.