Search code examples
ruby-on-railsunit-testingmigrationruby-1.8.7

Unit tests fail after migrating from rails 2.0.1 to 2.3.17


After migration from Rails 2.0.1 to 2.3.17 Unit Tests are not working. For each of them I am getting the same error:

"NoMethodError: undefined method `assert_valid_keys' for false:FalseClass".

Any clue?

  • RUBY VERSION: 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.8.0]
  • RUBYGEMS VERSION: 1.8.25

NoMethodError: undefined methodassert_valid_keys' for false:FalseClass (eval):12:in run' /Applications/RubyMine.app/rb/testing/patch/testunit/test/unit/ui/teamcity/testrunner.rb:93:insend' /Applications/RubyMine.app/rb/testing/patch/testunit/test/unit/ui/teamcity/testrunner.rb:93:in start_mediator' /Applications/RubyMine.app/rb/testing/patch/testunit/test/unit/ui/teamcity/testrunner.rb:81:instart'`


Solution

  • OK I think I have found the solution.

    In this app I am working on it is used plugin fixture_scenarios, so I have updated lib/fixture_scenarios.rb line #33 which was:

    connection.transaction(Thread.current['open_transactions'] == 0) do

    to

    connection.transaction(:requires_new => Thread.current['open_transactions'] == 0) do

    most of the tests have passed now.