diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2019-06-10 15:44:50 +0000 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-06-10 15:44:50 +0000 |
commit | c699c6fe3ce0a0dffecfa380377fa44a6866a148 (patch) | |
tree | 079289e2a8c8ba98241ccb90674495eccecd01c5 /spec | |
parent | de4e63b3fcec455549f69d604424c70205694e55 (diff) | |
download | gitlab-ce-c699c6fe3ce0a0dffecfa380377fa44a6866a148.tar.gz |
Fix nil coercion updating storage size on project statistics
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/project_statistics_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index 358873f9a2f..1cb49d83ffa 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -197,6 +197,18 @@ describe ProjectStatistics do expect(statistics.storage_size).to eq 9 end + + it 'works during wiki_size backfill' do + statistics.update!( + repository_size: 2, + wiki_size: nil, + lfs_objects_size: 3 + ) + + statistics.reload + + expect(statistics.storage_size).to eq 5 + end end describe '.increment_statistic' do |