作为请求规范的一部分,我试图注销用户:
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