spec: improve reliability of ttl refresh checking

Change-Id: I999f1a1117069349ad82883470f88263f1c94c27
Reviewed-on: https://gerrit.instructure.com/73468
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2016-03-01 19:33:29 -07:00
parent 9e1a4ed682
commit d9372669e6
1 changed files with 1 additions and 0 deletions

View File

@ -148,6 +148,7 @@ describe 'login' do
expect(response).to redirect_to(dashboard_url(:login_success => 1)) expect(response).to redirect_to(dashboard_url(:login_success => 1))
expect(session[:cas_session]).to eq cas_ticket expect(session[:cas_session]).to eq cas_ticket
Canvas.redis.expire(cas_redis_key, Pseudonym::CAS_TICKET_TTL / 2)
cas_ticket_ttl = Canvas.redis.ttl(cas_redis_key) cas_ticket_ttl = Canvas.redis.ttl(cas_redis_key)
get dashboard_url(:login_success => 1) get dashboard_url(:login_success => 1)
expect(Canvas.redis.ttl(cas_redis_key)).to be > cas_ticket_ttl expect(Canvas.redis.ttl(cas_redis_key)).to be > cas_ticket_ttl