0

作为请求规范的一部分,我试图注销用户:

sign_out @user

但我得到了错误

undefined method `sign_out' for #<Class:0x000000099a4b20> (NoMethodError)

代码:

require 'spec_helper'

include Warden::Test::Helpers

...

  before(:each) do
    @admin = Factory(:admin_user)
    sign_in @admin
  end

...
  context "When Admin users logout they are returned to the admin login." do
    before(:each) do
      sign_out(:user)
    end
    subject { current_path }
    it { should == new_admin_user_session_path }
  end
4

1 回答 1

1

AFAICT,devise提供了一个sign_out助手,但warden提供了一个logout助手。

只是一些快速的谷歌搜索,我不是专家。

于 2012-08-29T01:59:56.037 回答