Commit daa801c8 authored by Tyler Amos's avatar Tyler Amos

Adds over_storage_limit? method to EE::Namespace

Returns a boolean indicating whether the given namespace's root
ancestor is over the storage limit.
parent bdefe8a7
......@@ -182,6 +182,10 @@ module EE
actual_plan_name
end
def over_storage_limit?
::Namespace::RootStorageSize.new(root_ancestor).above_size_limit?
end
def actual_size_limit
::Gitlab::CurrentSettings.repository_size_limit
end
......
......@@ -1310,6 +1310,18 @@ RSpec.describe Namespace do
end
end
describe '#over_storage_limit?' do
before do
allow_next_instance_of(::Namespace::RootStorageSize, namespace.root_ancestor) do |project|
allow(project).to receive(:above_size_limit?).and_return(true)
end
end
it 'returns a boolean indicating whether the root namespace is over the storage limit' do
expect(namespace.over_storage_limit?).to be true
end
end
describe '#actual_size_limit' do
let(:namespace) { build(: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