Commit eca9ae6c authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'leaky-constant-fix-38' into 'master'

Fix leaky constant in factory spec

See merge request gitlab-org/gitlab!32174
parents 2cf296ca f75a0f7b
......@@ -354,7 +354,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/lib/gitlab/ci/config/entry/retry_spec.rb'
- 'spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb'
- 'spec/lib/gitlab/cluster/mixins/unicorn_http_server_spec.rb'
- 'spec/lib/gitlab/config/entry/factory_spec.rb'
- 'spec/lib/gitlab/config/entry/simplifiable_spec.rb'
- 'spec/lib/gitlab/database/migration_helpers_spec.rb'
- 'spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb'
......
---
title: Fix leaky constant issue in factory spec
merge_request: 32174
author: Rajendra Kadam
type: fixed
......@@ -4,13 +4,16 @@ require 'spec_helper'
describe Gitlab::Config::Entry::Factory do
describe '#create!' do
class Script < Gitlab::Config::Entry::Node
before do
stub_const('Script', Class.new(Gitlab::Config::Entry::Node))
Script.class_eval do
include Gitlab::Config::Entry::Validatable
validations do
validates :config, array_of_strings: true
end
end
end
let(:entry) { Script }
let(:factory) { described_class.new(entry) }
......
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