diff options
Diffstat (limited to 'test/controllers/admin_controller_test.rb')
| -rw-r--r-- | test/controllers/admin_controller_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/controllers/admin_controller_test.rb b/test/controllers/admin_controller_test.rb index a177851f..9747d8e9 100644 --- a/test/controllers/admin_controller_test.rb +++ b/test/controllers/admin_controller_test.rb | |||
| @@ -45,4 +45,17 @@ class AdminControllerTest < ActionController::TestCase | |||
| 45 | get :index | 45 | get :index |
| 46 | assert_redirected_to edit_user_path(users(:quentin)) | 46 | assert_redirected_to edit_user_path(users(:quentin)) |
| 47 | end | 47 | end |
| 48 | |||
| 49 | test "a session older than the absolute limit is rejected" do | ||
| 50 | login_as :quentin | ||
| 51 | @request.session[:logged_in_at] = (AuthenticatedSystem::SESSION_MAX_AGE.ago - 1.day).to_i | ||
| 52 | get :index | ||
| 53 | assert_response :redirect | ||
| 54 | end | ||
| 55 | |||
| 56 | test "a fresh session carries the login stamp" do | ||
| 57 | login_as :quentin | ||
| 58 | get :index | ||
| 59 | assert_response :success | ||
| 60 | end | ||
| 48 | end | 61 | end |
