documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

JammitControllerTest fails with "uninitialized constant ActionDispatch::Routing::Routes" #99

Closed audionerd closed 13 years ago

audionerd commented 13 years ago

I get four routing-related errors in JammitControllerTest:

  1) Error:
test_package_with_jst(JammitControllerTest):
NameError: uninitialized constant ActionDispatch::Routing::Routes
    ./test/unit/test_jammit_controller.rb:23:in `setup'
    /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/testing/setup_and_teardown.rb:66:in `run'
    /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/callbacks.rb:423:in `_run_setup_callbacks'
    /Library/Ruby/Gems/1.8/gems/activesupport-3.0.3/lib/active_support/testing/setup_and_teardown.rb:65:in `run'

This code appears to be the culprit:

ActionController::Routing::Routes.draw do |map|
  Jammit::Routes.draw(map)
end

I also get "Jammit Warning: Asset compression disabled -- Java unavailable.", but I'm assuming that's triggered by "test_loading_a_nonexistent_java", and unrelated to this issue.

It's quite possible I'm doing something very wrong that's causing this, and I would love to know what it is :) Any advice?

jashkenas commented 13 years ago

Tests are passing for me, for both Ruby 1.8 and Ruby 1.9... It's probably an issue with your particular version of Rails 3 -- at DocumentCloud, we're still on Rails 2. So I'm afraid I can't be of much help. If you want to get the tests working, you'll probably have to dig in a debug the load error.

audionerd commented 13 years ago

Yes, it was just a Rails 3 issue. I tried with Rails 2.3.10 and the tests do pass. Thanks.