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 "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 "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]
37 test "config maps' keys are returned as symbols" do
38 assert Rails.configuration.Users.AutoSetupUsernameBlacklist.is_a? ActiveSupport::OrderedOptions
39 assert Rails.configuration.Users.AutoSetupUsernameBlacklist.keys.size > 0
40 Rails.configuration.Users.AutoSetupUsernameBlacklist.keys.each do |k|