tl;dr: Check out test_track!
How To Test from within the Pipeline
With a mind for testing, we approached the asset pipeline with caution. Sure, concat'ing and compiling all of our front end code is great, but how can it be integrated with a test suite?
It works by appending some default locations into an application's
asset_path and creating routes that include the test runner html and
pages, with no additional overhead for the developer.
Working with test_track
Once the test_track gem is added to your project, you just need to
create a test manifest in
that includes require statements for any test files. Here's what a
sample test manifest would look like:
With that in place, all you need to do is mount the engine in
mount TestTrack::Engine => 'test'
And now you can run your Jasmine and Qunit tests at '/test/jasmine' and '/test/qunit'.
test_track is available as gem, so to include it in your project, just add
to your project's Gemfile and you're off to the races! You can checkout test_track on GitHub.