backporting fix to rails/rails#8119 from

https://github.com/rails/rails/commit/445f14e97553de552745de26ebd5e49bc5c82f4e
(e.g. to deal with jasmine-rails spec/assets paths)

see also https://discussion.heroku.com/t/using-the-rails-4-asset-pipeline-in-rails-3-apps-for-faster-deploys/205/18 and https://github.com/rails/sprockets-rails/issues/114#issuecomment-37314592