diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-20 15:07:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-20 15:07:25 +0300 |
commit | 07b1e2691206717206d40f9c7f0abfd1a30ecbdd (patch) | |
tree | a5b6b9655d73f158c22ecc70bcb65535226fd4ac /spec/tasks/gitlab | |
parent | 65a0673d76bb86d6acca6dc3ab42dc91a04f56c2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks/gitlab')
-rw-r--r-- | spec/tasks/gitlab/user_management_rake_spec.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/tasks/gitlab/user_management_rake_spec.rb b/spec/tasks/gitlab/user_management_rake_spec.rb index b13b004aaa4..e8de4511c1d 100644 --- a/spec/tasks/gitlab/user_management_rake_spec.rb +++ b/spec/tasks/gitlab/user_management_rake_spec.rb @@ -2,7 +2,7 @@ require 'rake_helper' -RSpec.describe 'gitlab:user_management tasks', :silence_stdout do +RSpec.describe 'gitlab:user_management tasks', :silence_stdout, feature_category: :groups_and_projects do before do Rake.application.rake_require 'tasks/gitlab/user_management' end @@ -18,7 +18,7 @@ RSpec.describe 'gitlab:user_management tasks', :silence_stdout do context 'with users' do let(:user_1) { create(:user, projects_limit: 10, can_create_group: true) } - let(:user_2) { create(:user, projects_limit: 10, can_create_group: true) } + let(:user_2) { create(:user, :blocked, projects_limit: 10, can_create_group: true) } let(:user_other) { create(:user, projects_limit: 10, can_create_group: true) } shared_examples 'updates proper users' do @@ -78,6 +78,19 @@ RSpec.describe 'gitlab:user_management tasks', :silence_stdout do it_behaves_like 'updates proper users' end + + context 'when updated rows do not match the member count' do + before do + group.add_developer(user_1) + group.add_developer(user_2) + + allow(User).to receive_message_chain(:where, :update_all).and_return(1) + end + + it 'returns an error message' do + expect { run_rake }.to output(/.*Something went wrong.*/).to_stdout + end + end end end end |