Sha256: 5bbc6a7f60c71eb83dd26f84d9bf59c50301cfdeadbceb25e969f36523c20c37

Contents?: true

Size: 571 Bytes

Versions: 10

Compression:

Stored size: 571 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

10 entries across 10 versions & 1 rubygems

Version Path
authenticate-0.7.3 spec/model/lifetimed_spec.rb
authenticate-0.7.2 spec/model/lifetimed_spec.rb
authenticate-0.7.1 spec/model/lifetimed_spec.rb
authenticate-0.7.0 spec/model/lifetimed_spec.rb
authenticate-0.6.1 spec/model/lifetimed_spec.rb
authenticate-0.6.0 spec/model/lifetimed_spec.rb
authenticate-0.5.0 spec/model/lifetimed_spec.rb
authenticate-0.4.0 spec/model/lifetimed_spec.rb
authenticate-0.3.3 spec/model/lifetimed_spec.rb
authenticate-0.3.2 spec/model/lifetimed_spec.rb