我想测试应用程序中的每条路由,并了解到我应该在集成测试中这样做:Where to test routes in ruby on rails
但是我收到以下错误:
NoMethodError: undefined method `authenticate?' for nil:NilClass
/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/devise-2.1.2/lib/devise/rails/routes.rb:286:in `block in authenticated'
网上有说在集成测试中不能使用 Devise::TestHelpers -- Devise Google Group , Devise Github page
如何测试如下路线?
# config/routes.rb
devise_for :users
authenticated :user do
root to: 'static#home'
end
root to: 'static#landing'
我正在运行测试单元测试$ rake test:integration