On Wed, Jun 4, 2008 at 4:29 AM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 3, 2008 at 7:27 PM, Matt McNeil <[EMAIL PROTECTED]> wrote:
>> Yes, application.rb appears to be getting loaded twice.  Things are fine
>> when the before_filter is being called from the UsersController:
>>
>> class UsersController < ApplicationController
>>
> Do you require application.rb from anywhere, but including the whole
> path?  i.e. require File.join(RAILS_ROOT, "app", "controllers",
> "application").  If you require the same file twice, but using two
> different paths, then it'll be loaded twice.
>
> This may happen from a plugin you've got loaded as well.
>

I've been seeing the same problem. In my case the symptom was a
warning about redefining a constant I have in ApplicationController.

I checked across my application and the only places I see application
being required (outside vendor/rails) are script/spec_server (and it's
template) and rspec-rails/lib/spec/rails.rb.

> Another thing to check is the paths in your generated specs.  I
> changed those a couple weeks ago, but to avoid this type of problem.
> I may have screwed up, or perhaps you've got a mix of requires from
> older gen'd specs and newer ones.
>

I'm not sure what "paths in your generated specs" means to check this myself.

Regards,

Matt

-- 
Matt Mower :: http://matt.blogs.it/
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to