Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActionController::Integration::Session is missing Test::Unit::Assertions

#1481

With the edge version, something has changed in the Integration::Session module which prevents Shoulda from loading. I believe this error is with rails, as nothing from Shoulda shows up in the stacktrace.

Reproduce:


rails newapp

## environment.rb
  config.gem "thoughtbot-shoulda", :lib => "shoulda/rails", :source => "http://gems.github.com"

script/console

I worked around it by adding the 'test/unit/assertions' dependency to the top of the integration.rb file. Not sure if this is the correct fix, please review.

Reported by Andrew Vit · November 26th, 2008 @ 02:28 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Andrew Vit
    Andrew Vit
    • Tag changed from assertions, integration_test, regression, testing to assertions, dependencies, gems, testing

    I'm pretty sure the patch I attached is totally naïve. I just looked at the commit log and I see there's a recent change to use autoloading instead of explicit requires...

    For the record, here's what the stack says:

    uninitialized constant Test::Unit::Assertions
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:437:in `load_missing_constant'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:77:in `const_missing'
    /Users/andrew/Sites/edge230/vendor/rails/actionpack/lib/action_controller/integration.rb:14
    /Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.0.5/lib/shoulda/controller.rb:22
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:516:in `new_constants_in'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.0.5/lib/shoulda/rails.rb:6
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:516:in `new_constants_in'
    /Users/andrew/Sites/edge230/vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /Users/andrew/Sites/edge230/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:94:in `load'
    /Users/andrew/Sites/edge230/config/../vendor/rails/railties/lib/initializer.rb:300:in `load_gems'
    

    November 26th, 2008 @ 09:03 PM

  2. josh