3 class ApplicationTest < ActiveSupport::TestCase
4 include CurrentApiClient
6 test "test act_as_system_user" do
7 Thread.current[:user] = users(:active)
8 assert_equal users(:active), Thread.current[:user]
10 assert_not_equal users(:active), Thread.current[:user]
11 assert_equal system_user, Thread.current[:user]
13 assert_equal users(:active), Thread.current[:user]
16 test "test act_as_system_user is exception safe" do
17 Thread.current[:user] = users(:active)
18 assert_equal users(:active), Thread.current[:user]
22 assert_not_equal users(:active), Thread.current[:user]
23 assert_equal system_user, Thread.current[:user]
30 assert_equal users(:active), Thread.current[:user]