带有 devise 和 rspec 的未初始化常量 UsersController
我已经配置了一个新的 Rails 3 应用程序,带有 devise 和 rspec。我遵循了 devise wiki,并放入
RSpec.configure do |config|
config.include Devise::TestHelpers, :type => :controller
end
了spec/spec_helper.rb。无论如何,当我尝试运行控制器规范时,出现错误:
spec/controllers/users_controller_spec.rb:3:in `<top (required)>': uninitialized constant UsersController (NameError)
听起来设计引擎类在测试时在加载路径中不可用。有什么想法吗?
I have configured a new rails 3 app, with devise and rspec. I have followed the devise wiki, and put
RSpec.configure do |config|
config.include Devise::TestHelpers, :type => :controller
end
in spec/spec_helper.rb. Anyways, when I try to run the controllers spec, I have the error :
spec/controllers/users_controller_spec.rb:3:in `<top (required)>': uninitialized constant UsersController (NameError)
Sounds like devise engine classes are not available in loadpath while testing. Any idea ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UserController
可能丢失。如果没有的话可以粘贴到这里吗?
UserController
might be missing.If not, can you paste it here?