diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2019-06-10 16:59:46 +0200 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2019-06-10 16:59:46 +0200 |
commit | 11790387de2310394de6c1faf0408bfabd363b2e (patch) | |
tree | c5964912c251e209b240e4cc9dfe77b880fedd07 | |
parent | f67e1bec9699a7f6c5eb11005e95ccf80949eb42 (diff) | |
download | gitlab-ce-ac-63020-typeerror-nil-can-t-be-coerced-into-integer.tar.gz |
Add a test caseac-63020-typeerror-nil-can-t-be-coerced-into-integer
-rw-r--r-- | changelogs/unreleased/ac-63020-typeerror-nil-can-t-be-coerced-into-integer.yml | 5 | ||||
-rw-r--r-- | spec/models/project_statistics_spec.rb | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/changelogs/unreleased/ac-63020-typeerror-nil-can-t-be-coerced-into-integer.yml b/changelogs/unreleased/ac-63020-typeerror-nil-can-t-be-coerced-into-integer.yml new file mode 100644 index 00000000000..51ac2358fba --- /dev/null +++ b/changelogs/unreleased/ac-63020-typeerror-nil-can-t-be-coerced-into-integer.yml @@ -0,0 +1,5 @@ +--- +title: Fix nil coercion updating storage size on project statistics +merge_request: 29425 +author: +type: fixed 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 |