在测试上遇到问题设计注册Cucumber。 “注册”后点击 表明 未初始化的常量User :: ArticlesController(ActionController :: RoutingError) 我想那是因为在注册之后,设计重定向记录用户到文章页面,但它不在命名空间User下。因为我测试用户它将所有内容放在这个命名空间下。
答案 0 :(得分:0)
This Devise howto表示您可以通过命名user_route路径来路由到不在User命名空间下的内容:
match 'my/dashboard' => 'my/dashboard#index', :as => 'user_root'
所以听起来你可以这样做:
match 'articles' => 'articles#index', :as => 'user_root'