You can use config.assets.prefix , but that will put the assets into a shared directory anyway (see here for the rake task, which combines public_path and the prefix).
In your case, this should work:
Rails.application.config.assets.prefix = "../spec/javascripts/generated/assets" Rails.application.config.assets.manifest = File.join(Rails.public_path, config.assets.prefix)
I had to indicate the manifest path due to the strange loading order of railtie stars. Without it, it gets stuck in public/assets , which does not exist and explodes the rake task. YMMV.
Side note: I tried this first in the development environment, but config.assets.prefix refused to change. I suspect that setting config.assets.enabled to true would fix this, but I have not had time to test it yet.
As a bonus, assets:clean works great with this solution (you can see it for yourself in the rake task )
source share