summaryrefslogtreecommitdiff
path: root/spec/models/projects/build_artifacts_size_refresh_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/projects/build_artifacts_size_refresh_spec.rb')
-rw-r--r--spec/models/projects/build_artifacts_size_refresh_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/models/projects/build_artifacts_size_refresh_spec.rb b/spec/models/projects/build_artifacts_size_refresh_spec.rb
index 21cd8e0b9d4..caff06262d9 100644
--- a/spec/models/projects/build_artifacts_size_refresh_spec.rb
+++ b/spec/models/projects/build_artifacts_size_refresh_spec.rb
@@ -67,6 +67,8 @@ RSpec.describe Projects::BuildArtifactsSizeRefresh, type: :model do
let!(:last_job_artifact_id_on_refresh_start) { create(:ci_job_artifact, project: refresh.project) }
+ let(:statistics) { refresh.project.statistics }
+
before do
stats = create(:project_statistics, project: refresh.project, build_artifacts_size: 120)
stats.increment_counter(:build_artifacts_size, 30)
@@ -89,11 +91,11 @@ RSpec.describe Projects::BuildArtifactsSizeRefresh, type: :model do
end
it 'resets the build artifacts size stats' do
- expect { refresh.process! }.to change { refresh.project.statistics.build_artifacts_size }.to(0)
+ expect { refresh.process! }.to change { statistics.build_artifacts_size }.to(0)
end
it 'resets the counter attribute to zero' do
- expect { refresh.process! }.to change { refresh.project.statistics.get_counter_value(:build_artifacts_size) }.to(0)
+ expect { refresh.process! }.to change { statistics.counter(:build_artifacts_size).get }.to(0)
end
end