Sha256: 781124b86dca7a5865aef394dcac52011d0c6a82ba52cf93670c907e8b44d61f

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 Bytes

Contents

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


describe Authenticate::Model::Timeoutable do
  subject { create(:user) }

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

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