Commit 68d7a3c5 authored by Ragnar-H's avatar Ragnar-H

Make remaining_additional_purchased_storage natural number

parent 429836ae
......@@ -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