This project is archived and is in readonly mode.

#2343 ✓stale
Gerrit Kaiser

cache_classes = false causes weird integration test failures

Reported by Gerrit Kaiser | March 26th, 2009 @ 05:55 AM | in 3.x

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.

Comments and changes to this ticket

  • Gerrit Kaiser

    Gerrit Kaiser March 26th, 2009 @ 05:59 AM

    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.
    
    
  • Glenn Gillen

    Glenn Gillen September 3rd, 2009 @ 01:11 PM

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

  • Ravi

    Ravi November 2nd, 2009 @ 10:00 PM

    • 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.

  • Jeremy Kemper

    Jeremy Kemper May 4th, 2010 @ 06:48 PM

    • Milestone changed from 2.x to 3.x
  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:40 PM

    • 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.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:40 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages