Sha256: 82f616555d6fa248695f60cf34501d35028db1073e14901a3571eca778a26bae

Contents?: true

Size: 630 Bytes

Versions: 9

Compression:

Stored size: 630 Bytes

Contents

require 'spec_helper'

describe CASino::AuthTokenTicket do
  describe '.cleanup' do
    it 'deletes expired auth token tickets' do
      ticket = described_class.new ticket: 'ATT-12345'
      ticket.save!
      ticket.created_at = 10.minutes.ago
      ticket.save!
      lambda do
        described_class.cleanup
      end.should change(described_class, :count).by(-1)
      described_class.find_by_ticket('ATT-12345').should be_falsey
    end
  end

  describe '#to_s' do
    it 'returns the ticket identifier' do
      ticket = described_class.new ticket: 'ATT-12345'
      "#{ticket}".should == ticket.ticket
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
casino-4.1.2 spec/model/auth_token_ticket_spec.rb
casino-4.1.1 spec/model/auth_token_ticket_spec.rb
casino-4.1.0 spec/model/auth_token_ticket_spec.rb
casino-4.0.3 spec/model/auth_token_ticket_spec.rb
casino-4.0.2 spec/model/auth_token_ticket_spec.rb
casino-4.0.1 spec/model/auth_token_ticket_spec.rb
casino-4.0.0 spec/model/auth_token_ticket_spec.rb
casino-4.0.0.pre.2 spec/model/auth_token_ticket_spec.rb
casino-4.0.0.pre.1 spec/model/auth_token_ticket_spec.rb