ITeye博客

restful_authentication 中 单元测试问题

xanderzhang · 2009-07-16 10:11 · Ruby/rails · 单元测试 · ActiveRecord · Markdown

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.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。