[LRUG] Fwd: Testing JS in Rails 4

James Coglan jcoglan at gmail.com
Wed Jul 31 07:30:52 PDT 2013


On 31 July 2013 15:25, George Sheppard <george at fuzzmonkey.co.uk> wrote:

> I'm not sure how to do this, and Rails 4 seems to have a bunch of stuff
> hard-coded that's not configurable (e.g. it minifies code in production but
> not development and none of the config flags for this change anything).
> Where are the docs?
>
>
> Rather than messing with the digests themselves you could use the
> manifest.json file to find the fingerprinted asset names from the the
> filenames. The only problem being that the manifest.json file is also
> fingerprinted... It's generated after rake assets:precompile in
> public/assets
>

Turtles all the way down :/ In general, a JS test harness does not have the
ability to read directory listings, unless you're running a local static
server with CORS enabled, and even then you've got a bunch of glue code to
write just to figure out which file to load, if your testing platform will
even let you do that. Better to have a script with a predictable
hard-codable pathname as the entry point to the test runner.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20130731/cf4f2c4c/attachment-0003.html>


More information about the Chat mailing list