Commit d77a2ab6 authored by Stan Hu's avatar Stan Hu

Merge branch...

Merge branch '9800-500-error-when-trying-to-update-project-surpassing-repository-limit-through-the-web-interface' into 'master'

Resolve "500 error when trying to update project surpassing repository limit through the Web interface"

Closes #9800

See merge request gitlab-org/gitlab-ee!9579
parents e40b591d 1f0edaa3
......@@ -16,7 +16,7 @@ module EE
def validate_repository_size!
if project.above_size_limit?
raise_error(Gitlab::RepositorySizeError.new(project).commit_error)
raise_error(::Gitlab::RepositorySizeError.new(project).commit_error)
end
end
end
......
---
title: Fix access to constant Gitlab::RepositorySizeError
merge_request: 9579
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
describe Commits::CreateService do
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
project.add_maintainer(user)
end
subject(:service) do
described_class.new(project, user, start_branch: 'master', branch_name: 'master')
end
describe '#execute' do
before do
stub_licensed_features(repository_size_limit: true)
project.update!(repository_size_limit: 1)
allow(project).to receive(:repository_and_lfs_size).and_return(2)
end
subject(:result) { service.execute }
it 'raises an error if the repositoy exceeds the size limit' do
expect(result[:status]).to be(:error)
expect(result[:message]).to eq('Your changes could not be committed, because this repository has exceeded its size limit of 1 Byte by 1 Byte')
end
end
end
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