Module: Kraut::Rails::Spec::LoginHelper

Defined in:
lib/kraut/rails/spec/login_helper.rb

Instance Method Summary collapse

Instance Method Details

#login!Object



9
10
11
12
# File 'lib/kraut/rails/spec/login_helper.rb', line 9

def login!
  Kraut::Application.stubs(:authentication_required?).returns(false)
  session[:user] = create_user
end

#logout!Object



14
15
16
# File 'lib/kraut/rails/spec/login_helper.rb', line 14

def logout!
  session[:user] = nil
end

#userObject



18
19
20
# File 'lib/kraut/rails/spec/login_helper.rb', line 18

def user
  session[:user]
end