1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class ApplicationTest < ActiveSupport::TestCase
8 include CurrentApiClient
10 test "test act_as_system_user" do
11 Thread.current[:user] = users(:active)
12 assert_equal users(:active), Thread.current[:user]
14 assert_not_equal users(:active), Thread.current[:user]
15 assert_equal system_user, Thread.current[:user]
17 assert_equal users(:active), Thread.current[:user]
20 test "test act_as_system_user is exception safe" do
21 Thread.current[:user] = users(:active)
22 assert_equal users(:active), Thread.current[:user]
26 assert_not_equal users(:active), Thread.current[:user]
27 assert_equal system_user, Thread.current[:user]
34 assert_equal users(:active), Thread.current[:user]