我想使用 Authlogic 为登录用户编写一些单元测试。为了正确开始,我使用了一些托管在 http://github.com/binarylogic/authlogic_example 中的代码。 .但是在 rake 测试 之后我得到一个错误,因为“test_helper.rb”和下面的类:
class ActionController::TestCase
setup :activate_authlogic
end
这是我的错误:
NameError: undefined local variable or method `activate_authlogic' for
我认为这个 Authlogic 示例是映射到 Rails 2 上的;也许它在 Rails 3 上有点不同。是否有其他示例可以作为单元测试的示例?
非常感谢。
最佳答案
您是否需要'authlogic/test_case'
和include Authlogic::TestCase
?
我有一个类似的问题(虽然使用 rspec)并通读了 http://github.com/trevmex/authlogic_rails3_example 处的代码
关于unit-testing - 使用 Authlogic on Rails 3 进行单元测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2999283/