diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-10 03:06:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-10 03:06:44 +0300 |
commit | 308146dc398fd4c13453048105498018459e0985 (patch) | |
tree | d843eb63c1672e4b18c483907e2cd4aa7fca708e /spec/lib/gitlab/git_access_spec.rb | |
parent | 4b28d5ae770c6bd332283a3f13ceae06329c409b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/git_access_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git_access_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb index d584cdbe280..81dc96b538a 100644 --- a/spec/lib/gitlab/git_access_spec.rb +++ b/spec/lib/gitlab/git_access_spec.rb @@ -541,6 +541,13 @@ describe Gitlab::GitAccess do expect { pull_access_check }.to raise_unauthorized('Your account has been blocked.') end + it 'disallows deactivated users to pull' do + project.add_maintainer(user) + user.deactivate! + + expect { pull_access_check }.to raise_unauthorized("Your account has been deactivated by your administrator. Please log back in from a web browser to reactivate your account at #{Gitlab.config.gitlab.url}") + end + context 'when the project repository does not exist' do it 'returns not found' do project.add_guest(user) @@ -925,6 +932,12 @@ describe Gitlab::GitAccess do project.add_developer(user) end + it 'does not allow deactivated users to push' do + user.deactivate! + + expect { push_access_check }.to raise_unauthorized("Your account has been deactivated by your administrator. Please log back in from a web browser to reactivate your account at #{Gitlab.config.gitlab.url}") + end + it 'cleans up the files' do expect(project.repository).to receive(:clean_stale_repository_files).and_call_original expect { push_access_check }.not_to raise_error |