Sha256: 1fbcdbdbd91b23fb4b7779c1733d7002dc5f90820c091ae8cce46437500b0e88

Contents?: true

Size: 574 Bytes

Versions: 2

Compression:

Stored size: 574 Bytes

Contents

require 'spec_helper'
require 'authenticate/model/lifetimed'


describe Authenticate::Model::Lifetimed do
  context '#max_session_lifetime_exceeded?' do

    it 'passes fresh sessions' do
      Timecop.freeze do
        user = create(:user, current_sign_in_at: 1.minute.ago.utc)
        expect(user).to_not be_max_session_lifetime_exceeded
      end
    end

    it 'detects timed out sessions' do
      Timecop.freeze do
        user = create(:user, current_sign_in_at: 5.hours.ago.utc)
        expect(user).to be_max_session_lifetime_exceeded
      end
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authenticate-0.3.1 spec/model/lifetimed_spec.rb
authenticate-0.3.0 spec/model/lifetimed_spec.rb