diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-28 21:10:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-28 21:10:01 +0300 |
commit | f14814c9815f86a95808f089ff219d4e768641c0 (patch) | |
tree | bca9f6f2719c693748479776b766786922b026e2 /spec/lib/gitlab/request_profiler | |
parent | f7f0c0502763777f48964774a87b0a34dfb1d9ab (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/request_profiler')
-rw-r--r-- | spec/lib/gitlab/request_profiler/profile_spec.rb | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/spec/lib/gitlab/request_profiler/profile_spec.rb b/spec/lib/gitlab/request_profiler/profile_spec.rb deleted file mode 100644 index 30e23a99b22..00000000000 --- a/spec/lib/gitlab/request_profiler/profile_spec.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::RequestProfiler::Profile do - let(:profile) { described_class.new(filename) } - - describe '.new' do - context 'using old filename' do - let(:filename) { '|api|v4|version.txt_1562854738.html' } - - it 'returns valid data' do - expect(profile).to be_valid - expect(profile.request_path).to eq('/api/v4/version.txt') - expect(profile.time).to eq(Time.at(1562854738).utc) - expect(profile.type).to eq('html') - end - end - - context 'using new filename' do - let(:filename) { '|api|v4|version.txt_1563547949_execution.html' } - - it 'returns valid data' do - expect(profile).to be_valid - expect(profile.request_path).to eq('/api/v4/version.txt') - expect(profile.profile_mode).to eq('execution') - expect(profile.time).to eq(Time.at(1563547949).utc) - expect(profile.type).to eq('html') - end - end - end - - describe '#content_type' do - context 'when using html file' do - let(:filename) { '|api|v4|version.txt_1562854738_memory.html' } - - it 'returns valid data' do - expect(profile).to be_valid - expect(profile.content_type).to eq('text/html') - end - end - - context 'when using text file' do - let(:filename) { '|api|v4|version.txt_1562854738_memory.txt' } - - it 'returns valid data' do - expect(profile).to be_valid - expect(profile.content_type).to eq('text/plain') - end - end - - context 'when file is unknown' do - let(:filename) { '|api|v4|version.txt_1562854738_memory.xxx' } - - it 'returns valid data' do - expect(profile).not_to be_valid - expect(profile.content_type).to be_nil - end - end - end -end |