Commit 9eb4dffe authored by Phil Hughes's avatar Phil Hughes

Merge branch 'flash-messages-scb' into 'master'

Resolve CE/EE diffs in _flash_messages

Closes #11037

See merge request gitlab-org/gitlab-ee!12726
parents c12624f0 585c4866
......@@ -8,5 +8,4 @@
= render 'shared/shared_runners_minutes_limit', project: project
- unless project.empty_repo?
= render 'shared/auto_devops_implicitly_enabled_banner', project: project
- if project.above_size_limit?
= render 'above_size_limit_warning'
= render_if_exists 'projects/above_size_limit_warning', project: project
.alert.alert-warning.d-none.d-sm-block
= project_above_size_limit_message
- if project.above_size_limit?
.alert.alert-warning.d-none.d-sm-block
= project_above_size_limit_message
......@@ -9,6 +9,27 @@ describe ProjectsController do
sign_in(user)
end
describe "GET show" do
let(:public_project) { create(:project, :public, :repository) }
render_views
it 'shows the over size limit warning message if above_size_limit' do
allow_any_instance_of(EE::Project).to receive(:above_size_limit?).and_return(true)
allow(controller).to receive(:current_user).and_return(user)
get :show, params: { namespace_id: public_project.namespace.path, id: public_project.path }
expect(response.body).to match(/The size of this repository.+exceeds the limit/)
end
it 'does not show an over size warning if not above_size_limit' do
get :show, params: { namespace_id: public_project.namespace.path, id: public_project.path }
expect(response.body).not_to match(/The size of this repository.+exceeds the limit/)
end
end
describe 'POST create' do
let!(:params) do
{
......
......@@ -237,29 +237,6 @@ describe ProjectsController do
get :show, params: { namespace_id: public_project.namespace, id: public_project }
expect(response).to render_template('_readme')
end
context 'project repo over limit' do
before do
allow_any_instance_of(EE::Project)
.to receive(:above_size_limit?).and_return(true)
project.add_maintainer(user)
end
it 'shows the over size limit warning message for project members' do
allow(controller).to receive(:current_user).and_return(user)
get :show, params: { namespace_id: public_project.namespace.path, id: public_project.path }
expect(response).to render_template('_above_size_limit_warning')
end
it 'does not show the message for non members' do
get :show, params: { namespace_id: public_project.namespace.path, id: public_project.path }
expect(response).not_to render_template('_above_size_limit_warning')
end
end
end
context "when the url contains .atom" do
......
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