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:
Diffstat (limited to 'spec/lib/gitlab/application_context_spec.rb')
-rw-r--r--spec/lib/gitlab/application_context_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/gitlab/application_context_spec.rb b/spec/lib/gitlab/application_context_spec.rb
index 5ecec978017..55f5ae7d7dc 100644
--- a/spec/lib/gitlab/application_context_spec.rb
+++ b/spec/lib/gitlab/application_context_spec.rb
@@ -125,6 +125,17 @@ RSpec.describe Gitlab::ApplicationContext do
.to include(project: project.full_path, root_namespace: project.full_path_components.first)
end
+ it 'contains known keys' do
+ context = described_class.new(project: project)
+
+ # Make sure all possible keys would be included
+ allow(context).to receive_message_chain(:set_values, :include?).and_return(true)
+
+ # If a newly added key is added to the context hash, we need to list it in
+ # the known keys constant. This spec ensures that we do.
+ expect(context.to_lazy_hash.keys).to contain_exactly(*described_class.known_keys)
+ end
+
describe 'setting the client' do
let_it_be(:remote_ip) { '127.0.0.1' }
let_it_be(:runner) { create(:ci_runner) }