Commit ffcc200a authored by Markus Doits's avatar Markus Doits

fix allowed keys validator to use correct attribute as error base?

parent 452a4399
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
unknown_keys = value.try(:keys).to_a - options[:in] unknown_keys = value.try(:keys).to_a - options[:in]
if unknown_keys.any? if unknown_keys.any?
record.errors.add(:config, "#{attribute} contains unknown keys: " + record.errors.add(attribute, "contains unknown keys: " +
unknown_keys.join(', ')) unknown_keys.join(', '))
end end
end end
......
...@@ -187,7 +187,7 @@ describe Gitlab::Ci::Config::Entry::Job do ...@@ -187,7 +187,7 @@ describe Gitlab::Ci::Config::Entry::Job do
it 'returns error about the unknown key' do it 'returns error about the unknown key' do
expect(entry).not_to be_valid expect(entry).not_to be_valid
expect(entry.errors) 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
end end
......
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