Commit ac8ff3f8 authored by James Lopez's avatar James Lopez

Merge branch...

Merge branch '276091-do-not-lock-projects-under-free-limit-when-namespace-contains-locked-project' into 'master'

Make remaining_additional_purchased_storage natural number

See merge request gitlab-org/gitlab!46772
parents d978f9ab 68d7a3c5
......@@ -48,7 +48,7 @@ module EE
end
def remaining_additional_purchased_storage
additional_purchased_storage - total_excess_without_current_project
[additional_purchased_storage - total_excess_without_current_project, 0].max
end
end
end
......
......@@ -197,6 +197,17 @@ RSpec.describe Gitlab::RepositorySizeChecker do
end
context 'without additional purchased storage' do
context 'when namespace has total_repository_size_excess but project is below limit' do
let(:total_repository_size_excess) { 50 }
let(:change_size) { 1.megabyte }
let(:limit) { 10 }
let(:current_size) { 5 }
it 'returns zero' do
expect(subject.exceeded_size(change_size)).to eq(0)
end
end
include_examples 'checker size exceeded'
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