summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-07-18 15:38:06 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-07-18 15:38:06 +0200
commit7cef4f1908d99743bf1dfb9c1cfdd6b2936b2b3d (patch)
tree3f6eb86dffcf85d8184663f6da8593bf5181eaf4 /spec/lib
parent24b686ebb64e2f5a02d812e9aa726f1ba0868c2e (diff)
downloadgitlab-ce-7cef4f1908d99743bf1dfb9c1cfdd6b2936b2b3d.tar.gz
Improve valid keys validation for CI config nodes
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/ci/config/node/artifacts_spec.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/spec/lib/gitlab/ci/config/node/artifacts_spec.rb b/spec/lib/gitlab/ci/config/node/artifacts_spec.rb
index 4973f7d599a..418a88cabac 100644
--- a/spec/lib/gitlab/ci/config/node/artifacts_spec.rb
+++ b/spec/lib/gitlab/ci/config/node/artifacts_spec.rb
@@ -21,12 +21,23 @@ describe Gitlab::Ci::Config::Node::Artifacts do
end
context 'when entry value is not correct' do
- let(:config) { { name: 10 } }
-
describe '#errors' do
- it 'saves errors' do
- expect(entry.errors)
- .to include 'artifacts name should be a string'
+ context 'when value of attribute is invalid' do
+ let(:config) { { name: 10 } }
+
+ it 'reports error' do
+ expect(entry.errors)
+ .to include 'artifacts name should be a string'
+ end
+ end
+
+ context 'when there is uknown key' do
+ let(:config) { { test: 100 } }
+
+ it 'reports error' do
+ expect(entry.errors)
+ .to include 'artifacts config contains unknown keys: test'
+ end
end
end
end