Brought to you by www.skinnyboard.comTestingJSinRails-TuesdayMay 5th, 2009 @ 1:45pm
==============================================- rake js/fixtures -> will run in browser
-Screw.UnitandSmoke-You can stub out jQuery andPrototype instead of testing them
- uses HTML fixtures
- but those could be limiting, thus you can do an almost factory girl approach and use jQuery to generate an HTML snippet to act as your HTML fixture
- blueridge plugin for rspec similar testing functionality
From the GitProjectPage======================BlueRidgeJavaScriptTestingRailsPluginTheBlueRidgeJavaScriptTestingRailsPlugin adds support for command-line andin-browser JavaScript unit tests to your Rails app. It bundles several great tools together in a convention-over-configuration, Rails-like way. These tools include:
*Rhino- a Java-based JavaScript interpreter
*Screw.Unit- a behaviour-driven development syntax forJavaScript similar to RSpec*Smoke- a JavaScript mocking & stubbing library similar to Mocha* env.js- a DOM implementation written entirely inJavaScript=======================How to get started?
=====================- blueridge is a plugin that combines several usefull JS testing tools
- there is an awesome Textmate bundle that gives snippets and allows you to run tests from within Textmate-ProjectPage: github.com/relevance/blue-ridge
Benefits=====================-BDDJavaScript code similar to rspec or mocha
-Pair programming inJavaScriptDrawbacks===================- based on Screw.Unit whose development is outdated - they're working on this...Brought to you by www.skinnyboard.com