Commit 798f5542 authored by Phil Hughes's avatar Phil Hughes

Merge branch '271399-do-not-render-two-alerts-to-inform-project-is-locked' into 'master'

Do not render two alerts to inform project is locked

See merge request gitlab-org/gitlab!46239
parents 6ffccfdc eece7f34
- size_checker = project.repository_size_checker
- if size_checker.above_size_limit?
- if size_checker.above_size_limit? && !project&.namespace&.additional_repo_storage_by_namespace_enabled?
.gl-alert.gl-alert-warning.gl-display-none.gl-display-sm-block
= sprite_icon('warning', css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title')
= size_checker.error_message.above_size_limit_message
......@@ -20,11 +20,31 @@ RSpec.describe ProjectsController do
subject { get :show, params: { namespace_id: public_project.namespace.path, id: public_project.path } }
context 'with additional_repo_storage_by_namespace_enabled? enabled' do
before do
allow_any_instance_of(EE::Namespace).to receive(:additional_repo_storage_by_namespace_enabled?).and_return(true)
end
it 'does not show over size limit warning when above_size_limit' do
allow_next_instance_of(Gitlab::RepositorySizeChecker) do |checker|
expect(checker).to receive(:above_size_limit?).and_return(true)
end
subject
expect(response.body).not_to match(/The size of this repository.+exceeds the limit/)
end
end
context 'with additional_repo_storage_by_namespace_enabled? disabled' do
before do
allow_any_instance_of(EE::Namespace).to receive(:additional_repo_storage_by_namespace_enabled?).and_return(false)
end
it 'shows the over size limit warning message if above_size_limit' do
allow_next_instance_of(Gitlab::RepositorySizeChecker) do |checker|
expect(checker).to receive(:above_size_limit?).and_return(true)
end
allow(controller).to receive(:current_user).and_return(user)
subject
......@@ -36,6 +56,7 @@ RSpec.describe ProjectsController do
expect(response.body).not_to match(/The size of this repository.+exceeds the limit/)
end
end
context 'namespace storage limit' do
let(:namespace) { public_project.namespace }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment