Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/instrumentation_helper_spec.rb')
-rw-r--r--spec/lib/gitlab/instrumentation_helper_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/gitlab/instrumentation_helper_spec.rb b/spec/lib/gitlab/instrumentation_helper_spec.rb
index 52d3623c304..a9663012e9a 100644
--- a/spec/lib/gitlab/instrumentation_helper_spec.rb
+++ b/spec/lib/gitlab/instrumentation_helper_spec.rb
@@ -147,6 +147,25 @@ RSpec.describe Gitlab::InstrumentationHelper do
expect(payload).not_to include(:caught_up_replica_pick_fail)
end
end
+
+ context 'when there is an uploaded file' do
+ it 'adds upload data' do
+ uploaded_file = UploadedFile.from_params({
+ 'name' => 'dir/foo.txt',
+ 'sha256' => 'sha256',
+ 'remote_url' => 'http://localhost/file',
+ 'remote_id' => '1234567890',
+ 'etag' => 'etag1234567890',
+ 'upload_duration' => '5.05',
+ 'size' => '123456'
+ }, nil)
+
+ subject
+
+ expect(payload[:uploaded_file_upload_duration_s]).to eq(uploaded_file.upload_duration)
+ expect(payload[:uploaded_file_size_bytes]).to eq(uploaded_file.size)
+ end
+ end
end
describe 'duration calculations' do