Commit 16296f3a authored by Stan Hu's avatar Stan Hu

Merge branch '227133-storage-limit-namespace-policy' into 'master'

Adds over_storage_limit? method to EE::Namespace

See merge request gitlab-org/gitlab!36358
parents 38264776 daa801c8
......@@ -175,6 +175,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