X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3dc2b0008be4e09b47f73aeeb97d005cd7836619..55b94087ff4590c54cf1f43d941c6cb24153dded:/apps/workbench/test/functional/users_controller_test.rb diff --git a/apps/workbench/test/functional/users_controller_test.rb b/apps/workbench/test/functional/users_controller_test.rb index c67c56b5c7..8b026cb14f 100644 --- a/apps/workbench/test/functional/users_controller_test.rb +++ b/apps/workbench/test/functional/users_controller_test.rb @@ -1,4 +1,25 @@ require 'test_helper' class UsersControllerTest < ActionController::TestCase + test "valid token works in functional test" do + get :index, {}, session_for(:active) + assert_response :success + end + + test "ignore previously valid token (for deleted user), don't crash" do + get :welcome, {}, session_for(:valid_token_deleted_user) + assert_response :success + assert_nil assigns(:my_jobs) + assert_nil assigns(:my_ssh_keys) + end + + test "expired token redirects to api server login" do + get :show, { + id: api_fixture('users')['active']['uuid'] + }, session_for(:expired_trustedclient) + assert_response :redirect + assert_match /^#{Rails.configuration.arvados_login_base}/, @response.redirect_url + assert_nil assigns(:my_jobs) + assert_nil assigns(:my_ssh_keys) + end end