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:
authorMarkus Doits <markus.doits@stellenticket.de>2018-09-19 19:03:12 +0300
committerMarkus Doits <markus.doits@stellenticket.de>2018-11-07 15:01:57 +0300
commitffcc200a68fd6d08707a8fd70b128a79206fd69e (patch)
treeaf1f3afd9c62a3f5f0ab578d3a58ed52da972ee9
parent452a4399be2a2a869b2e3f7487669e0c5c74dcb2 (diff)
fix allowed keys validator to use correct attribute as error base?
-rw-r--r--lib/gitlab/ci/config/entry/validators.rb4
-rw-r--r--spec/lib/gitlab/ci/config/entry/job_spec.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/ci/config/entry/validators.rb b/lib/gitlab/ci/config/entry/validators.rb
index 137694ff93d..af902eb0ee8 100644
--- a/lib/gitlab/ci/config/entry/validators.rb
+++ b/lib/gitlab/ci/config/entry/validators.rb
@@ -10,8 +10,8 @@ module Gitlab
unknown_keys = value.try(:keys).to_a - options[:in]
if unknown_keys.any?
- record.errors.add(:config, "#{attribute} contains unknown keys: " +
- unknown_keys.join(', '))
+ record.errors.add(attribute, "contains unknown keys: " +
+ unknown_keys.join(', '))
end
end
end
diff --git a/spec/lib/gitlab/ci/config/entry/job_spec.rb b/spec/lib/gitlab/ci/config/entry/job_spec.rb
index 9941c975517..9054e909a44 100644
--- a/spec/lib/gitlab/ci/config/entry/job_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/job_spec.rb
@@ -187,7 +187,7 @@ describe Gitlab::Ci::Config::Entry::Job do
it 'returns error about the unknown key' do
expect(entry).not_to be_valid
expect(entry.errors)
- .to include 'job config retry contains unknown keys: unknown_key, one_more'
+ .to include 'job retry contains unknown keys: unknown_key, one_more'
end
end