X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0561bd0c3c07257fd58ded6c7cfa5feeae97af57..5dbc1ae3d451f904654a2a61e5df620808ac175d:/apps/workbench/test/controllers/users_controller_test.rb diff --git a/apps/workbench/test/controllers/users_controller_test.rb b/apps/workbench/test/controllers/users_controller_test.rb index ce9282ff77..393b864dc5 100644 --- a/apps/workbench/test/controllers/users_controller_test.rb +++ b/apps/workbench/test/controllers/users_controller_test.rb @@ -35,6 +35,14 @@ class UsersControllerTest < ActionController::TestCase assert_match /\/users\/welcome/, @response.redirect_url end + test "'log in as user' feature uses a v2 token" do + post :sudo, { + id: api_fixture('users')['active']['uuid'] + }, session_for('admin_trustedclient') + assert_response :redirect + assert_match /api_token=v2%2F/, @response.redirect_url + end + test "request shell access" do user = api_fixture('users')['spectator'] @@ -69,14 +77,14 @@ class UsersControllerTest < ActionController::TestCase if username == 'admin' assert_match /Home<\/a>/, @response.body assert_match /Home<\/a>/, @response.body - assert_match /href="\/users\/#{admin_user['uuid']}" title="show user"><\/i> Show<\/a/, @response.body - assert_match /href="\/users\/#{active_user['uuid']}" title="show user"><\/i> Show<\/a/, @response.body + assert_match /href="\/users\/#{admin_user['uuid']}"><\/i> Show<\/a/, @response.body + assert_match /href="\/users\/#{active_user['uuid']}"><\/i> Show<\/a/, @response.body assert_includes @response.body, admin_user['email'] assert_includes @response.body, active_user['email'] else refute_match /Home<\/a>/, @response.body - refute_match /href="\/users\/#{admin_user['uuid']}" title="show user"><\/i> Show<\/a/, @response.body - assert_match /href="\/users\/#{active_user['uuid']}" title="show user"><\/i> Show<\/a/, @response.body + refute_match /href="\/users\/#{admin_user['uuid']}"><\/i> Show<\/a/, @response.body + assert_match /href="\/users\/#{active_user['uuid']}"><\/i> Show<\/a/, @response.body assert_includes @response.body, active_user['email'] end end