Search code examples
ruby-on-rails-3rspec2rspec-rails

undefined method `assertions' in routing spec


1) JunksController routing routes to #index Failure/Error: get("/junks").should route_to("junks#index") NoMethodError: undefined method `assertions' for #<#<Class:0x007ff8d62c8568>:0x007ff8d13e2f20> # ./spec/routing/junks_routing_spec.rb:7:in `block (3 levels) in <top (required)>'

The only hint I have is that MiniTest v5 is throwing deprecation warnings.

MiniTest::Unit::TestCase is now Minitest::Test. From /Users/username/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/test/unit/testcase.rb:8:in `<module:Unit>'

In a recent update of Gems, I started getting an undefined method `assertions' for all of my routing specs. I generated a new scaffold, it too is raising the same error

Versions:

  • rails (3.2.13)
  • rspec (2.13.0)
  • rspec-core (~> 2.13.0)
  • rspec-expectations (~> 2.13.0)
  • rspec-mocks (~> 2.13.0)
  • rspec-rails (2.13.2)
  • minitest (5.0.2)
  • capybara (2.1.0)
  • rack-test (0.6.2)

Solution

  • It turns out the Minitest gem was the culprit. I locked the gem's version and all routing specs are passing again. Yea!

    gem 'minitest', '~> 4.0'