我对Rails很陌生。我想测试我的activeadmin资源,如下面的链接所述
https://github.com/activeadmin/activeadmin/wiki/Testing-your-ActiveAdmin-controllers-with-RSpec
我的简单测试如下
require 'spec_helper'
describe "activeadmin resources" do
it "should have admin user resource" do
ActiveAdmin.application.namespaces[:admin].resources.should have_key("AdminUser")
end
end但我知道这个错误
NameError: uninitialized constant ActiveAdmin`我试图在spec_helper中要求activeadmin gem,但没有用。有什么想法吗?
发布于 2015-06-03 17:21:11
只是通过改变
要求'spec_helper‘
至
要求'rails_helper‘
错误解决了。
https://stackoverflow.com/questions/30625620
复制相似问题