Closed james2m closed 13 years ago
I'm sorry, but what exactly is the bug you're reporting, or change you're proposing here?
In jammit.rb:11
ASSET_ROOT = File.expand_path((defined?(Rails) && Rails.root.to_s.length > 0) ? Rails.root : ".") unless defined?(ASSET_ROOT)
If Rails.root isn't set it uses the present working directory '.' surely you should first check for RAILS_ROOT and use that first.
The lack of check for RAILS_ROOT causes tests to fail when a view is rendered if the test isn't run from the root of the application for example if you run the test stand alone from within textmate.
Sure thing .. here's the fallback for the regular RAILS_ROOT
:
aaaceb7373a5e193cd6c97b25400a08fbb8d8c5f
Cool. Thanks.
Because test_helper.rb relies on Rails.root being set it defaults to the current directory. So running individual tests will set the ASSET_ROOT based on the current directory.
I'm not sure why the ASSET_ROOT uses the current directory if it can't find Rails.root. I would have thought it would be better to then look for RAILS_ROOT and use that if Rails.root doesn't exist yet.
To overcome this for the moment I am overriding ASSET_ROOT in test_helper.rb;