Commit ce0fb87c authored by Douwe Maan's avatar Douwe Maan

Merge branch '2055-lfs-objects-being-counted-twice' into 'master'

removes the duplicate sum of lfs objects

Closes #2055

See merge request !1599
parents 000037cb 82e7eb75
...@@ -1497,7 +1497,7 @@ class Project < ActiveRecord::Base ...@@ -1497,7 +1497,7 @@ class Project < ActiveRecord::Base
end end
def repository_and_lfs_size def repository_and_lfs_size
statistics.storage_size + statistics.lfs_objects_size statistics.total_repository_size
end end
def above_size_limit? def above_size_limit?
......
---
title: Removes duplicate count of LFS objects from repository_and_lfs_size method
merge_request: 1599
author:
...@@ -2019,6 +2019,19 @@ describe Project, models: true do ...@@ -2019,6 +2019,19 @@ describe Project, models: true do
end end
end end
describe '#repository_and_lfs_size' do
let(:project) { create(:project) }
let(:size) { 50 }
before do
allow(project.statistics).to receive(:total_repository_size).and_return(size)
end
it 'returns the total repository and lfs size' do
expect(project.repository_and_lfs_size).to eq(size)
end
end
describe '#approver_group_ids=' do describe '#approver_group_ids=' do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
......
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