Changeset 5060
- Timestamp:
- 09/07/06 12:37:26 (2 years ago)
- Files:
-
- plugins/javascript_test/CHANGELOG (added)
- plugins/javascript_test/README (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/javascript_test/README
r5059 r5060 1 JavaScript testing plugin 2 ========================= 1 =JavaScript testing plugin 3 2 4 3 This plugin provides the script.aculo.us JavaScript unit testing framework 5 in way that integrates with Rails applications.4 in a way that integrates with Rails applications. 6 5 7 Usage 8 ===== 6 ==Usage 9 7 10 8 Use the provided generator to built a skeleton for your JavaScript test. … … 16 14 about your app, just add tests. :) 17 15 18 Example 19 ======= 16 ==Example 20 17 21 18 Generate a JavaScript test skeleton for your public/javascripts/foo.js file: 22 19 23 script/generate javascript_test foo20 script/generate javascript_test foo 24 21 25 Run the unit tests (a "assertTruth" dummy test is provided, so you should see 26 "SUCCESS" messages): 22 Run the unit tests (an "assertTruth" dummy test is provided, 23 so you should see "SUCCESS" messages), and see the automagically 24 controlled browsers in action: 27 25 28 rake test:javascripts 26 rake test:javascripts 27 28 You have to manually close the browser window(s) afterwards. 29 30 All in all, unittest.js is closely modelled on Test::Unit and there's 31 also experimental support for RSpec-style BDD testing. You can find lots 32 of examples in both the Prototype and script.aculo.us SVN repositories. 29 33 30 34 You'll find more info on how to write tests on the script.aculo.us wiki: 31 http://wiki.script.aculo.us/scriptaculous/show/UnitTesting 35 http://wiki.script.aculo.us/scriptaculous/show/UnitTesting. 36 The documentation there is not really complete, so feel free to help out. 32 37 33 Questions? 34 ========== 38 ==Questions? 35 39 36 40 Join the Rails Spinoffs Google Group, or ask on #prototype on irc.freenode.net. 37 41 38 TODO 39 ==== 42 ==Credits 43 44 Big thanks with sugar on the top to Jon Tirsen, who authored the automated 45 browser remote control-niceties. 46 47 ==TODO 40 48 41 49 * Some more docs and a presentation :) 42 50 * Make ^C aborting work 43 51 52 == License 53 44 54 Copyright (c) 2005-2006 Thomas Fuchs, released under the MIT license