vendredi 25 octobre 2019

Rails 6 - tests failing due to ActionPack .empty? for nil:NilClass

I've recently upgraded my rails app from 6.0.0.beta3 to 6.0.0 and all my tests that use a route either _path or _url I get the following error:

HomeControllerTest#test_should_see_home_page:
NoMethodError: undefined method `empty?' for nil:NilClass
    /.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:781:in `optimize_routes_generation?'
    /.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/url_for.rb:220:in `optimize_routes_generation?'
    /.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:228:in `optimize_routes_generation?'
    /.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:198:in `call'
    /.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:329:in `block in define_url_helper'
    /.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/testing/integration.rb:404:in `public_send'
    /.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/testing/integration.rb:404:in `method_missing'
    /code/events/test/controllers/home_controller_test.rb:6:in `block in <class:HomeControllerTest>'

Has anyone see this before? Maybe I've missed a configuration during the upgrade? My application works fine in a browser, it's the tests that seem affected.

Aucun commentaire:

Enregistrer un commentaire