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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-29 09:09:22 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-29 09:09:22 +0300
commit47702dd42fdf551289927f9fed67b73e803bde2d (patch)
tree0398697f43cbfd2b628101d9595c043311bc652c /spec/models
parentc201d59a4f031bb198e9541c57b4fd026388f5be (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_statistics_spec.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb
index f3f1e43f6c5..1a3283dfe51 100644
--- a/spec/models/project_statistics_spec.rb
+++ b/spec/models/project_statistics_spec.rb
@@ -430,7 +430,25 @@ RSpec.describe ProjectStatistics do
storage_size: 0
)
- expect { subject }.to change { statistics.storage_size }.from(0).to(28)
+ expect { subject }.to change { statistics.reload.storage_size }.from(0).to(28)
+ end
+
+ context 'when nullable columns are nil' do
+ before do
+ statistics.update_columns(
+ repository_size: 2,
+ wiki_size: nil,
+ storage_size: 0
+ )
+ end
+
+ it 'does not raise any error' do
+ expect { subject }.not_to raise_error
+ end
+
+ it 'recalculates storage size from its components' do
+ expect { subject }.to change { statistics.reload.storage_size }.from(0).to(2)
+ end
end
it_behaves_like 'obtaining lease to update database' do