Sha256: 3b4562b9ccdbe234f11a79087ee731f9c271e46bbfe5c8f265e2d756cc7c131c

Contents?: true

Size: 380 Bytes

Versions: 25

Compression:

Stored size: 380 Bytes

Contents

module SpecLoginHelper
  def sign_in(user)
    request.cookies[:remember_token] = user.remember_token
    self.current_user = user
  end

  def current_user
    @current_user ||= User.users.find_by_remember_token(request.cookies[:remember_token])
  end

  def current_user=(user)
    @current_user = user
  end
end

RSpec.configure do |config|
  config.include SpecLoginHelper
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
adeia-0.9.2 spec/support/spec_login_helper.rb
adeia-0.9.1 spec/support/spec_login_helper.rb
adeia-0.9.0 spec/support/spec_login_helper.rb
adeia-0.8.6 spec/support/spec_login_helper.rb
adeia-0.8.5 spec/support/spec_login_helper.rb
adeia-0.8.4 spec/support/spec_login_helper.rb
adeia-0.8.3 spec/support/spec_login_helper.rb
adeia-0.8.2 spec/support/spec_login_helper.rb
adeia-0.8.1 spec/support/spec_login_helper.rb
adeia-0.8.0 spec/support/spec_login_helper.rb
adeia-0.7.1 spec/support/spec_login_helper.rb
adeia-0.7.0 spec/support/spec_login_helper.rb
adeia-0.6.2 spec/support/spec_login_helper.rb
adeia-0.6.1 spec/support/spec_login_helper.rb
adeia-0.6.0 spec/support/spec_login_helper.rb
adeia-0.5.6 spec/support/spec_login_helper.rb
adeia-0.5.5 spec/support/spec_login_helper.rb
adeia-0.5.4 spec/support/spec_login_helper.rb
adeia-0.5.3 spec/support/spec_login_helper.rb
adeia-0.5.2 spec/support/spec_login_helper.rb