Commit db2277b8 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Fix leaky constant in cache headers spec and issues importer spec

parent 1f2f456c
...@@ -361,8 +361,6 @@ RSpec/LeakyConstantDeclaration: ...@@ -361,8 +361,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/lib/gitlab/git/diff_collection_spec.rb' - 'spec/lib/gitlab/git/diff_collection_spec.rb'
- 'spec/lib/gitlab/import_export/import_test_coverage_spec.rb' - 'spec/lib/gitlab/import_export/import_test_coverage_spec.rb'
- 'spec/lib/gitlab/import_export/project/relation_factory_spec.rb' - 'spec/lib/gitlab/import_export/project/relation_factory_spec.rb'
- 'spec/lib/gitlab/jira_import/issues_importer_spec.rb'
- 'spec/lib/gitlab/no_cache_headers_spec.rb'
- 'spec/lib/gitlab/path_regex_spec.rb' - 'spec/lib/gitlab/path_regex_spec.rb'
- 'spec/lib/gitlab/quick_actions/dsl_spec.rb' - 'spec/lib/gitlab/quick_actions/dsl_spec.rb'
- 'spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb' - 'spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb'
......
---
title: Fix leaky constant issue importer and cache headers spec
merge_request: 32122
author: Rajendra Kadam
type: fixed
...@@ -39,8 +39,8 @@ describe Gitlab::JiraImport::IssuesImporter do ...@@ -39,8 +39,8 @@ describe Gitlab::JiraImport::IssuesImporter do
end end
context 'with results returned' do context 'with results returned' do
JiraIssue = Struct.new(:id) jira_issue = Struct.new(:id)
let_it_be(:jira_issues) { [JiraIssue.new(1), JiraIssue.new(2)] } let_it_be(:jira_issues) { [jira_issue.new(1), jira_issue.new(2)] }
def mock_issue_serializer(count) def mock_issue_serializer(count)
serializer = instance_double(Gitlab::JiraImport::IssueSerializer, execute: { key: 'data' }) serializer = instance_double(Gitlab::JiraImport::IssueSerializer, execute: { key: 'data' })
......
...@@ -3,8 +3,11 @@ ...@@ -3,8 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::NoCacheHeaders do describe Gitlab::NoCacheHeaders do
class NoCacheTester before do
include Gitlab::NoCacheHeaders stub_const('NoCacheTester', Class.new)
NoCacheTester.class_eval do
include Gitlab::NoCacheHeaders
end
end end
describe "#no_cache_headers" do describe "#no_cache_headers" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment