Sha256: 4a6403664b6012217886d6c914b8419e0ad21eef919ae7b1917d6ebcd6b0fe3f

Contents?: true

Size: 1.2 KB

Versions: 23

Compression:

Stored size: 1.2 KB

Contents

# encoding: UTF-8
require File.dirname(__FILE__) + '/spec_helper'

module CASServer
end
require 'casserver/model'

describe CASServer::Model::LoginTicket, '.cleanup(max_lifetime, max_unconsumed_lifetime)' do
  let(:max_lifetime) { -1 }
  let(:max_unconsumed_lifetime) { -2 }

  before do
    load_server(File.dirname(__FILE__) + "/default_config.yml")
    reset_spec_database
    
    CASServer::Model::LoginTicket.create :ticket => 'test', :client_hostname => 'test.local'
  end

  it 'should destroy all tickets created before the max lifetime' do
    expect {
      CASServer::Model::LoginTicket.cleanup(max_lifetime, max_unconsumed_lifetime)
    }.to change(CASServer::Model::LoginTicket, :count).by(-1)
  end

  it 'should destroy all unconsumed tickets not exceeding the max lifetime' do
    expect {
      CASServer::Model::LoginTicket.cleanup(max_lifetime, max_unconsumed_lifetime)
    }.to change(CASServer::Model::LoginTicket, :count).by(-1)
  end
end

describe CASServer::Model::LoginTicket, '#to_s' do
  let(:ticket) { 'test' }

  before do
    @login_ticket = CASServer::Model::LoginTicket.new :ticket => ticket
  end

  it 'should delegate #to_s to #ticket' do
    @login_ticket.to_s.should == ticket
  end
end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
synapses-cas-0.1.11 spec/model_spec.rb
synapses-cas-0.1.10 spec/model_spec.rb
synapses-cas-0.1.9 spec/model_spec.rb
ror-rubycas-server-1.0.c spec/model_spec.rb
ror-rubycas-server-1.0.b spec/model_spec.rb
ror-rubycas-server-1.0.a spec/model_spec.rb
rubycas-server-1.1.2 spec/model_spec.rb
synapses-cas-0.1.8 spec/model_spec.rb
synapses-cas-0.1.7 spec/model_spec.rb
rubycas-server-1.1.1 spec/model_spec.rb
synapses-cas-0.1.6 spec/model_spec.rb
synapses-cas-0.1.5 spec/model_spec.rb
synapses-cas-0.1.4 spec/model_spec.rb
synapses-cas-0.1.3 spec/model_spec.rb
synapses-cas-0.1.2 spec/model_spec.rb
synapses-cas-0.1.1 spec/model_spec.rb
synapses-cas-0.1.0 spec/model_spec.rb
bmedia-casserver-1.1.3 spec/model_spec.rb
bmedia-casserver-1.1.2 spec/model_spec.rb
bmedia-casserver-1.1.1 spec/model_spec.rb