Rehabilitate Mocha JS tests, porting to Angular

Fix up paths to Timeline JavaScripts.

Make Rosie work with Angular specs: initial solution employs
`angular.injector()` to lookup constructors needed for factories.

* Add skeleton tests for TimelinesController
* Add skeleton tests for other models (Filter, Query, Sortation)

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Use more descriptive variable names in model tests

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Use Bower-installed Mocha, Chai in JS tests

* Keep using our own customised rosie.js (see 596c93a)

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Fix PlanningElement test fail after Mocha upgrade

Switch to `be.empty` assertion.

Deep Equals behaviour appears to have changed:
https://github.com/chaijs/chai/blob/master/ReleaseNotes.md#deep-equals

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Remove unused JS libraries from Mocha HTML page

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Use Bower-installed jQuery in JS tests

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Merge branch 'feature/ui-components-test-architecture-bower' into feature/ui-components-test-architecture-mocha-tests
Merge branch 'feature/ui-components-test-architecture-bower' into feature/ui-components-test-architecture-mocha-tests

Signed-off-by: Alex Coles <alex@alexbcoles.com>

Conflicts:
	bower.json
Merge branch 'feature/ui-components-test-architecture-bower' into feature/ui-components-test-architecture-mocha-tests

Signed-off-by: Alex Coles <alex@alexbcoles.com>

Conflicts:
	mocha/factories/color_factory.js
	mocha/factories/planning_element_factory.js
	mocha/factories/project_association_factory.js
	mocha/factories/project_factory.js
	mocha/factories/project_type_factory.js
	mocha/factories/reporting_factory.js
	mocha/factories/status_factory.js
	mocha/factories/timelines_factory.js
	mocha/factories/type_factory.js
	mocha/factories/user_factory.js
	mocha/tests/project_test.js
Fix tests for custom fields: load needed modules

See PR #1021.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Merge branch 'feature/ui-components-test-architecture-bower' into feature/ui-components-test-architecture-mocha-tests
Add Rake task wrapper to run Mocha/PhantomJS tests

Task #5331

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Configure Travis to execute Mocha/PhantomJS tests

Task #5331

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Config Travis CI to also set DB for Mocha test run

Tests will error-out if this environment variable is not set
(we may wish to refactor `ci:travis:prepare` task).

Task #5331

Signed-off-by: Alex Coles <alex@alexbcoles.com>
bundle update; Commit updated Gemfile.lock

Attempting to deal with the following Bundler issue:

    Fetching gem metadata from https://rubygems.org/........
    Fetching additional metadata from https://rubygems.org/..
    Resolving dependencies...
    You have requested:
      sprockets = 2.2.2.backport2

    The bundle currently has sprockets locked at 2.2.2.
    Try running `bundle update sprockets`

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Add workaround for asset precompilation failures

Extension-less files (e.g. READMEs) will cause Sprockets static
compilation (precompilation) to fail.

See issue: https://github.com/sstephenson/sprockets/issues/347

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Revert "Add workaround for asset precompilation failures"

This workaroud breaks precompilation of assets in nested folders.

This reverts commit c0d75333c1985af942789cac23ebf089b6b65b1e.
Configure whitelisting of assets to be precompiled

Replace default Rails configuration Proc with our own that checks
against a whitelist of extensions.

Poorly-built Bower components often include a number of files not
needed at runtime. This solution has the added benefit of keeping
non-essential files  (.gzip .map .json .md .php .sh .txt) from being
served to users.

This is an alternative solution to the one found in commit c0d7533
See issue: https://github.com/sstephenson/sprockets/issues/347

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Fix issue causing all assets to be precompiled

Matchers specified in config.assets.precompile (also referred to as
'filters' in the Sprockets internals) are called on each asset in the
assets load path and should return a boolean expression.
The String used in ThemeFinder is truthy. Because matchers are
[OR'd][1], this was causing all assets to precompiled.

 * Use a lambda rather than Proc to ensure arity is checked.

[1]:https://github.com/sstephenson/sprockets/blob/2.x/lib/sprockets/base.rb#L421

Signed-off-by: Alex Coles <alex@alexbcoles.com>
Add additional assets that should be precompiled

(per-page JavaScripts, plugins, etc.)

The issue in 265c30a4 likely obscured the fact that these should have
been explicitly specified.

Signed-off-by: Alex Coles <alex@alexbcoles.com>