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.

cache_classes = false causes weird integration test failures

#2343

Steps to reproduce (using rails 2.3.2):

  1. rails testapp
  2. script/generate model testmodel
  3. rake db:migrate
  4. script/generate integration TestMe

put the following in test_me_test.rb:


  ActionController::Routing::Routes.draw do |map|
    map.connect 'url', :controller => 'somename', :action => 'bang'
  end
  
  class SomenameController < ActionController::Base
    def bang;end
  end
  
  test 'calling id without request' do
    test = Testmodel.create!
    assert test.id
  end
  
  test "calling id with request" do
    test = Testmodel.create!
    get 'url'
    test.id
  end

…run the test. it will pass. now switch config.cache_classes = false to config.cache_classes = true in config/environments/test.rb. The second test will fail.

Reported by Gerrit Kaiser · March 26th, 2009 @ 05:55 AM

State: stale
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Gerrit Kaiser
    Gerrit Kaiser

    sorry, the last paragraph should read:

    …run the test. it will pass. now switch config.cache_classes = true to config.cache_classes = false in config/environments/test.rb. The second test will fail.
    
    

    March 26th, 2009 @ 05:59 AM

  2. Glenn Gillen
    Glenn Gillen

    I just ran into this problem too. Any ideas on a solution?

    September 3rd, 2009 @ 01:11 PM

  3. Ravi
    Ravi
    • Tag changed from 2.1.2, 2.3.2, cache_classes, config, integration, integration_test to 2.2.2, cache_classes, config, test

    Same problem here. I see one of my unit tests failing once I switch cache_classes = false in test.rb. Please post solution if known.

    November 2nd, 2009 @ 10:00 PM

  4. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  5. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Tag changed from 2.2.2, cache_classes, config, test to 222, cache_classes, config, test
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:40 PM

  6. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:40 PM