2871: add tests for get_n_objects_of_class helper method
[arvados.git] / apps / workbench / test / functional / users_controller_test.rb
1 require 'test_helper'
2
3 class UsersControllerTest < ActionController::TestCase
4   test "valid token works in functional test" do
5     get :index, {}, session_for(:active)
6     assert_response :success
7   end
8
9   test "ignore previously valid token (for deleted user), don't crash" do
10     get :welcome, {}, session_for(:valid_token_deleted_user)
11     assert_response :success
12     assert_nil assigns(:my_jobs)
13     assert_nil assigns(:my_ssh_keys)
14   end
15
16   test "expired token redirects to api server login" do
17     get :show, {
18       id: api_fixture('users')['active']['uuid']
19     }, session_for(:expired_trustedclient)
20     assert_response :redirect
21     assert_match /^#{Rails.configuration.arvados_login_base}/, @response.redirect_url
22     assert_nil assigns(:my_jobs)
23     assert_nil assigns(:my_ssh_keys)
24   end
25 end