diff options
Diffstat (limited to 'spec/models/project_statistics_spec.rb')
-rw-r--r-- | spec/models/project_statistics_spec.rb | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index 738398a06f9..c670b6aac56 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -124,30 +124,16 @@ describe ProjectStatistics do end describe '.increment_statistic' do - shared_examples 'a statistic that increases storage_size' do - it 'increases the statistic by that amount' do - expect { described_class.increment_statistic(project.id, stat, 13) } - .to change { statistics.reload.send(stat) || 0 } - .by(13) - end - - it 'increases also storage size by that amount' do - expect { described_class.increment_statistic(project.id, stat, 20) } - .to change { statistics.reload.storage_size } - .by(20) - end + it 'increases the statistic by that amount' do + expect { described_class.increment_statistic(project.id, :build_artifacts_size, 13) } + .to change { statistics.reload.build_artifacts_size } + .by(13) end - context 'when adjusting :build_artifacts_size' do - let(:stat) { :build_artifacts_size } - - it_behaves_like 'a statistic that increases storage_size' - end - - context 'when adjusting :packages_size' do - let(:stat) { :packages_size } - - it_behaves_like 'a statistic that increases storage_size' + it 'increases also storage size by that amount' do + expect { described_class.increment_statistic(project.id, :build_artifacts_size, 20) } + .to change { statistics.reload.storage_size } + .by(20) end context 'when the amount is 0' do |