From 42b01c19ca0b3c467983c6fb0b952be171a777c1 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sun, 14 Jul 2024 10:35:51 +0000 Subject: [PATCH] Adds test for bulk unlock users (#40913). git-svn-id: https://svn.redmine.org/redmine/trunk@22930 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/users_controller_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index b56fb9108..b4c9b3584 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -1186,6 +1186,22 @@ class UsersControllerTest < Redmine::ControllerTest assert User.find_by_id(2).locked? end + def test_bulk_unlock + [8, 9].each do |id| + user = User.find(id) + user.status = User::STATUS_LOCKED + user.save! + end + + assert_difference 'User.status(User::STATUS_LOCKED).count', -2 do + post :bulk_unlock, :params => {:ids => [8, 9]} + end + + assert_redirected_to '/users' + assert User.find_by_id(8).active? + assert User.find_by_id(9).active? + end + def test_bulk_lock_should_not_lock_current_user assert_difference 'User.status(User::STATUS_LOCKED).count', 1 do delete :bulk_lock, :params => {:ids => [2, 1]} -- 2.39.5