Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/namespace/root_storage_size_spec.rb')
-rw-r--r--spec/models/namespace/root_storage_size_spec.rb67
1 files changed, 0 insertions, 67 deletions
diff --git a/spec/models/namespace/root_storage_size_spec.rb b/spec/models/namespace/root_storage_size_spec.rb
deleted file mode 100644
index a8048b7f637..00000000000
--- a/spec/models/namespace/root_storage_size_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Namespace::RootStorageSize, type: :model do
- let(:namespace) { create(:namespace) }
- let(:current_size) { 50.megabytes }
- let(:limit) { 100 }
- let(:model) { described_class.new(namespace) }
- let(:create_statistics) { create(:namespace_root_storage_statistics, namespace: namespace, storage_size: current_size)}
-
- before do
- create_statistics
-
- stub_application_setting(namespace_storage_size_limit: limit)
- end
-
- describe '#above_size_limit?' do
- subject { model.above_size_limit? }
-
- context 'when limit is 0' do
- let(:limit) { 0 }
-
- it { is_expected.to eq(false) }
- end
-
- context 'when below limit' do
- it { is_expected.to eq(false) }
- end
-
- context 'when above limit' do
- let(:current_size) { 101.megabytes }
-
- it { is_expected.to eq(true) }
- end
- end
-
- describe '#usage_ratio' do
- subject { model.usage_ratio }
-
- it { is_expected.to eq(0.5) }
-
- context 'when limit is 0' do
- let(:limit) { 0 }
-
- it { is_expected.to eq(0) }
- end
-
- context 'when there are no root_storage_statistics' do
- let(:create_statistics) { nil }
-
- it { is_expected.to eq(0) }
- end
- end
-
- describe '#current_size' do
- subject { model.current_size }
-
- it { is_expected.to eq(current_size) }
- end
-
- describe '#limit' do
- subject { model.limit }
-
- it { is_expected.to eq(limit.megabytes) }
- end
-end