Posts

Showing posts with the label javascript

Rails Conf 2009 First Day of Sessions (Afternoon)

Did you know the Las Vegas Hilton charges you 3 dollars to print out a boarding pass? Jerks. JavaScript Testing in Rails: Fast, Headless, In-Browser. Pick Any Three. Larry Karnowski So blue_ridge is a javascript testing tool that mashes up a bunch of other tools to make testing javascript more or less like writing RSpec test. It's pretty cool. It uses Screw.Unit for the RSpec like lingo, Smoke for mocking, and Rhino to run the javascript tests without a browser (so you can integrate it into your Cruise Control build). http://github.com/relevance/blue-ridge/tree/master Blue-ridge is JQuery opinionated but can use Prototype without too much trouble. It has a textmate bundle so you can run your javascript tests with command-r You can have multiple describe blocks like RSpec. Definitely worth a look. Smacking Git Around - Advanced Git Tricks with Scott Chacon (GitHub) Scott is very smart and really funny but he talked very fast so if you want to see the full slide deck you can go t...

Automated Javascript Rails Testing

On my last project we did some javascript unit testing in browser using the unittest.js library from scriptaculous, but because it's kind of a pain to set up and integrate into your build, I didn't get it working on my current job. Which makes me a bad person. However, Dr Nic Williams has made yours and my life easier with his javascript_test plugin for rails. Now I can type: ruby script/generate javascript_test fancy_javascript_file And get a fancy_javascript_file_test.html to test my fancy_javascript_file.js. It's all set up to go right at the javascript file. Just open the html file in a browser and it runs the tests. The sweet doctor explains it all better than me so go check out his site. What I want to talk about is trying to integrate this into your Cruise Control build. The first problem we faced is that the tasks that come with the plugin don't close the tabs created in the browser. So after 10-20 builds, you're going to have way too many tabs an...