restful_authentication 中 单元测试问题

The tests installed by restful_authentication encounter undefined-method errors, starting with "undefined method fixtures'" for the unit tests. The problem seems to be that the tests derive only from Test::Unit::TestCase, whereas the relevant methods are defined in ActiveRecord::TestCase and ActionController::TestCase for unit and functional tests, respectively.

My current work-around is to change the base class by hand, e.g. to replace

class UserTest < Test::Unit::TestCase

with

class UserTest < ActiveRecord::TestCase

This addresses the error, so that the tests at least can run.

你可能感兴趣的:(单元测试,ActiveRecord)