diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/lib/gitlab/request_profiler_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/lib/gitlab/request_profiler_spec.rb')
-rw-r--r-- | spec/lib/gitlab/request_profiler_spec.rb | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/spec/lib/gitlab/request_profiler_spec.rb b/spec/lib/gitlab/request_profiler_spec.rb deleted file mode 100644 index 4d3b361efcb..00000000000 --- a/spec/lib/gitlab/request_profiler_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::RequestProfiler do - describe '.profile_token' do - it 'returns a token' do - expect(described_class.profile_token).to be_present - end - - it 'caches the token' do - expect(Rails.cache).to receive(:fetch).with('profile-token') - - described_class.profile_token - end - end - - context 'with temporary PROFILES_DIR' do - let(:tmpdir) { Dir.mktmpdir('profiler-test') } - let(:profile_name) { '|api|v4|version.txt_1562854738_memory.html' } - let(:profile_path) { File.join(tmpdir, profile_name) } - - before do - stub_const('Gitlab::RequestProfiler::PROFILES_DIR', tmpdir) - FileUtils.touch(profile_path) - end - - after do - FileUtils.rm_rf(tmpdir) - end - - describe '.remove_all_profiles' do - it 'removes Gitlab::RequestProfiler::PROFILES_DIR directory' do - described_class.remove_all_profiles - - expect(Dir.exist?(tmpdir)).to be false - end - end - - describe '.all' do - subject { described_class.all } - - it 'returns all profiles' do - expect(subject.map(&:name)).to contain_exactly(profile_name) - end - end - - describe '.find' do - subject { described_class.find(profile_name) } - - it 'returns all profiles' do - expect(subject.name).to eq(profile_name) - end - end - end -end |