<snip>

> 
> I don't think this is related, but we've narrowed it down to this bit of
> code, added to a test helper library, that was added to dynamically add
> routes for testing:
> 
> begin
>   _routes = Our::Application.routes
>   _routes.disable_clear_and_finalize = true
>   _routes.clear!
> 
>   Our::Application.routes_reloader.paths.each{ |path| load(path) }
> 
>   _routes.draw do
>     match "request404" => "application#request404"
>     match "request500" => "application#request500"
>     match "generic_request" => "application#generic_request"
>     match "login_required_request" =>
> "application#login_required_request"
>     match "authorize_school_request" =>
> "application#authorize_school_request"
>     match "authorize_school_without_redirect_request" =>
> "application#authorize_school_without_redirect_request"
>     match "redirect_back_request" => "application#redirect_back_request"
>     match "render_data_request" => "application#render_data_request"
>     match "cancant_request" => "application#cancant_request"
> 
>     match "redirect" => "legacy#redirect"
>   end
>   ActiveSupport.on_load(:action_controller) do
>     Our::Application.routes.finalize!
>   end
> ensure
>   _routes.disable_clear_and_finalize = false
> end
> 
> If we comment this out, and the tests that use the helper, the problem
> goes away.
> 
> BTW, I think the code came from http://openhood.com/rails/rails%
> 203/2010/07/20/add-routes-at-runtime-rails-3/ originally.
> 
> Still tinkering with it...

I decided to remove this code and simply put the routes in the
config/routes.rb file wrapped in an if block. That wasn't the issue,
though.

Based on my experiments, any attempt to reopen the ApplicationController
class causes the double run behavior. There were some instance variables
we wanted to get at directly, so we reopened the class and added some
accessors. If I comment that code and the related tests, CC is suddenly
happy again, even though they work fine from the command line.

Why? I haven't a clue. Very bizarre.

For now we're just going to comment them out and move on.

Regards,

Dan

_______________________________________________
Cruisecontrolrb-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/cruisecontrolrb-users

Reply via email to