我正在尝试运行涉及 Devise 的黄瓜测试,但以下代码失败:
When /^I logout$/ do
page.driver.submit :delete, destroy_user_session_path, {}
end
我收到的错误信息是:
No route matches [GET] "/" (ActionController::RoutingError)
./features/steps/authentication_steps.rb:16:in `/^I logout$/'
./features/steps/authentication_steps.rb:11:in `/^I am not logged in$/
features/authentication_admin.feature:8:in `And I am not logged in'
但是,当我执行 rake routes RAILS_ENV=test 时,该路线确实出现在我的路线中
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
有什么想法可以帮助我调试吗?谢谢!