diff options
author | Markus Doits <markus.doits@stellenticket.de> | 2018-09-19 18:03:12 +0200 |
---|---|---|
committer | Markus Doits <markus.doits@stellenticket.de> | 2018-11-07 13:01:57 +0100 |
commit | ffcc200a68fd6d08707a8fd70b128a79206fd69e (patch) | |
tree | af1f3afd9c62a3f5f0ab578d3a58ed52da972ee9 | |
parent | 452a4399be2a2a869b2e3f7487669e0c5c74dcb2 (diff) | |
download | gitlab-ce-ffcc200a68fd6d08707a8fd70b128a79206fd69e.tar.gz |
fix allowed keys validator to use correct attribute as error base?
-rw-r--r-- | lib/gitlab/ci/config/entry/validators.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/job_spec.rb | 2 |
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 |