X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/282562ff358c549980a48ccca41944039f86483a..7a2e9199172a3c102e8a6c7b723fd44bc031bda4:/services/api/test/functional/arvados/v1/users_controller_test.rb diff --git a/services/api/test/functional/arvados/v1/users_controller_test.rb b/services/api/test/functional/arvados/v1/users_controller_test.rb index fe24e441ce..cc0b5e1320 100644 --- a/services/api/test/functional/arvados/v1/users_controller_test.rb +++ b/services/api/test/functional/arvados/v1/users_controller_test.rb @@ -1101,7 +1101,38 @@ The Arvados team. assert_equal(1, Log.where(object_uuid: unchanginguuid).count) end - NON_ADMIN_USER_DATA = ["uuid", "kind", "is_active", "email", "first_name", + test 'batch update does not produce spurious log events' do + # test for bug #21304 + + existinguuid = 'remot-tpzed-foobarbazwazqux' + act_as_system_user do + User.create!(uuid: existinguuid, + first_name: 'root', + is_active: true, + ) + end + assert_equal(1, Log.where(object_uuid: existinguuid).count) + + Rails.configuration.Login.LoginCluster = 'remot' + + authorize_with(:admin) + patch(:batch_update, + params: { + updates: { + existinguuid => { + 'first_name' => 'root', + 'email' => '', + 'username' => '', + 'is_active' => true, + 'is_invited' => true + }, + }}) + assert_response(:success) + + assert_equal(1, Log.where(object_uuid: existinguuid).count) + end + + NON_ADMIN_USER_DATA = ["uuid", "kind", "is_active", "is_admin", "is_invited", "email", "first_name", "last_name", "username", "can_write", "can_manage"].sort def check_non_admin_index