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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-22 12:10:46 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-22 12:10:46 +0300
commit2e9f877e8b6dd58c8011745b1d9a28dd67c8179c (patch)
tree0e2d42aa2ef1c3ae386b54962815623466a3dd54 /spec/lib/marginalia_spec.rb
parentc86c0e01469fd7c9aa72283db23d539c02f44bdb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/marginalia_spec.rb')
-rw-r--r--spec/lib/marginalia_spec.rb83
1 files changed, 22 insertions, 61 deletions
diff --git a/spec/lib/marginalia_spec.rb b/spec/lib/marginalia_spec.rb
index fa0cd214c7e..2ee27fbe20c 100644
--- a/spec/lib/marginalia_spec.rb
+++ b/spec/lib/marginalia_spec.rb
@@ -37,26 +37,9 @@ RSpec.describe 'Marginalia spec' do
}
end
- context 'when the feature is enabled' do
- before do
- stub_feature(true)
- end
-
- it 'generates a query that includes the component and value' do
- component_map.each do |component, value|
- expect(recorded.log.last).to include("#{component}:#{value}")
- end
- end
- end
-
- context 'when the feature is disabled' do
- before do
- stub_feature(false)
- end
-
- it 'excludes annotations in generated queries' do
- expect(recorded.log.last).not_to include("/*")
- expect(recorded.log.last).not_to include("*/")
+ it 'generates a query that includes the component and value' do
+ component_map.each do |component, value|
+ expect(recorded.log.last).to include("#{component}:#{value}")
end
end
end
@@ -90,59 +73,37 @@ RSpec.describe 'Marginalia spec' do
}
end
- context 'when the feature is enabled' do
- before do
- stub_feature(true)
+ it 'generates a query that includes the component and value' do
+ component_map.each do |component, value|
+ expect(recorded.log.last).to include("#{component}:#{value}")
end
+ end
- it 'generates a query that includes the component and value' do
- component_map.each do |component, value|
- expect(recorded.log.last).to include("#{component}:#{value}")
- end
- end
-
- describe 'for ActionMailer delivery jobs' do
- let(:delivery_job) { MarginaliaTestMailer.first_user.deliver_later }
-
- let(:recorded) do
- ActiveRecord::QueryRecorder.new do
- delivery_job.perform_now
- end
- end
-
- let(:component_map) do
- {
- "application" => "sidekiq",
- "jid" => delivery_job.job_id,
- "job_class" => delivery_job.arguments.first
- }
- end
+ describe 'for ActionMailer delivery jobs' do
+ let(:delivery_job) { MarginaliaTestMailer.first_user.deliver_later }
- it 'generates a query that includes the component and value' do
- component_map.each do |component, value|
- expect(recorded.log.last).to include("#{component}:#{value}")
- end
+ let(:recorded) do
+ ActiveRecord::QueryRecorder.new do
+ delivery_job.perform_now
end
end
- end
- context 'when the feature is disabled' do
- before do
- stub_feature(false)
+ let(:component_map) do
+ {
+ "application" => "sidekiq",
+ "jid" => delivery_job.job_id,
+ "job_class" => delivery_job.arguments.first
+ }
end
- it 'excludes annotations in generated queries' do
- expect(recorded.log.last).not_to include("/*")
- expect(recorded.log.last).not_to include("*/")
+ it 'generates a query that includes the component and value' do
+ component_map.each do |component, value|
+ expect(recorded.log.last).to include("#{component}:#{value}")
+ end
end
end
end
- def stub_feature(value)
- stub_feature_flags(marginalia: value)
- Gitlab::Marginalia.set_enabled_from_feature_flag
- end
-
def make_request(correlation_id)
request_env = Rack::MockRequest.env_for('/')