Sha256: 98bfc3cce5cb100403a86ed531e920ec9ca5b340e9796e156c90fc6c3df8ad2f

Contents?: true

Size: 515 Bytes

Versions: 3

Compression:

Stored size: 515 Bytes

Contents

require 'spec_helper'
require 'authenticate/model/timeoutable'


describe Authenticate::Model::Timeoutable do
  before(:all) {
    Authenticate.configuration.timeout_in = 45.minutes
  }
  subject { create(:user) }

  it 'does not timeout while last_access_at is valid' do
    subject.last_access_at = 10.minutes.ago
    expect(subject.timedout?).to be_falsey
  end

  it 'does timeout when last_access_at is stale' do
    subject.last_access_at = 46.minutes.ago
    expect(subject.timedout?).to be_truthy
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authenticate-0.2.3 spec/model/timeoutable_spec.rb
authenticate-0.2.2 spec/model/timeoutable_spec.rb
authenticate-0.2.1 spec/model/timeoutable_spec.rb