Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10732 (closed enhancement: fixed)

Opened 8 months ago

Last modified 8 months ago

[PATCH] Bundle patch from various tickets

Reported by: nicwilliams Assigned to: madrobby
Priority: normal Milestone: 2.x
Component: Plugins Version: edge
Severity: normal Keywords: javascript_test
Cc:

Description

This patch is the aggregation of ideas from the following tickets for javascript_test plugin: #10662, #10667, #10669, #10694, #10694, #10697, and #10720.

The CHANGELOG additions are:

* Update to prototype + unittest 1.6.0.1 [nicwilliams]
  The prototype unittest.js had evolved away from scriptaculous's verision.
  NOTE: this involves the removal of the trial BDD system. Its possible people
  are actually using this.

* Generated setup + teardown have embedded with(this) {...} in them, like the test method [nicwilliams]

* TestCase has loadSample method to upload a local HTML file into page to use for testing.
  Best used within setup() method of Runners. [nicwilliams]
  
* Add -A/--use-app-assets generator option to allow usage of app's own prototype lib. [nicwillams]

Attachments

big_patch.patch (189.6 kB) - added by nicwilliams on 01/07/08 10:34:54.

Change History

01/07/08 10:34:00 changed by nicwilliams

Added to CHANGELOG

* Generates a public/javascripts/name.js library file when generating the test file [nicwilliams]

01/07/08 10:34:54 changed by nicwilliams

  • attachment big_patch.patch added.

01/09/08 17:05:33 changed by madrobby

  • status changed from new to closed.
  • resolution set to fixed.

(In [8610]) javascript_test: update prototype/unittest.js to latest 1.6.0.1 versions, generate public/javascripts/name.js file when using the generator, add option to use application-provided prototype.js file instead of the one that comes with the pluging. Fixes #10662, #10667, #10669, #10694, #10697 and #10732.

01/09/08 17:12:18 changed by madrobby

These two haven't made it in:

* Generated setup + teardown have embedded with(this) {...} in them, like the test method [nicwilliams]

* TestCase has loadSample method to upload a local HTML file into page to use for testing.
  Best used within setup() method of Runners. [nicwilliams]

For the with() construct, we want to move away from using it in the next major release of the unit test library.

The loadSample method is certainly a good idea but needs some fleshing out. The reason for this is that browsers can and have acted weirdly when using synchronous ajax requests, plus it can make a difference if HTML is there "from the file" vs. "inserted via DOM scripting". Also, file:// urls can be problematic. My suggestion is if you have lots and lots of testcases, just split them into several files (it might also mean that your javascript files are too large, so maybe split those into functional groups!). We can totally discuss this on the prototype-core google group.