Sha256: f00c7a4630f8da81315cc0aeb571aee689e887cc24fd7338a986e04bfe50a2b8

Contents?: true

Size: 304 Bytes

Versions: 15

Compression:

Stored size: 304 Bytes

Contents

module Minimalist
  module TestHelper
    # Sets the current user in the session from the user fixtures.
    def login_as(user)
      @request.session[:user_id] = user ? users(user).id : nil
    end
    
    def current_user
      @current_user ||= User.find(@request.session[:user_id])
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
minimalist_authentication-0.6.14 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.12 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.11 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.10 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.9 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.8 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.7 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.6 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.5 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.4 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.3 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.2 lib/minimalist/test_helper.rb
minimalist_authentication-0.6.1 lib/minimalist/test_helper.rb
minimalist_authentication-0.6 lib/minimalist/test_helper.rb
minimalist_authentication-0.5 lib/minimalist/test_helper.rb