Rails 3.0.9 + Devise + Cucumber + Capybara the infamous “No route matches /users/sign_out”

后端 未结 6 1865
我寻月下人不归
我寻月下人不归 2021-02-02 09:27

I am using devise 1.4.2 with rails 3.0.9, cucumber-rails 1.0.2, capybara 1.0.0. I got No route matches \"/users/sign_out\" error when I clicked logout. I added

6条回答
  •  忘掉有多难
    2021-02-02 10:18

    The right way to solve this problem is explained in the devise's wiki page: https://github.com/plataformatec/devise/wiki/How-To:-Test-with-Capybara

    Basically, once you have included on your user_step.rb file:

    include Warden::Test::Helpers
    Warden.test_mode!
    

    You may replace visit '/users/sign_out' with logout(:user)

提交回复
热议问题