summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-29 09:05:14 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-29 09:05:14 +0200
commit7c511c2f55f3e181983253d8b3ae74cd84e6844c (patch)
tree7adb9ed8a7cddf24cee1e08b5db06f24c0253934 /spec
parent2846f95d2a6a7418fb655f6588037bd3173fe77f (diff)
downloadgitlab-ce-7c511c2f55f3e181983253d8b3ae74cd84e6844c.tar.gz
Make it possible to set parent in CI config node
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/ci/config/node/factory_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/config/node/factory_spec.rb b/spec/lib/gitlab/ci/config/node/factory_spec.rb
index dd5f6e62b3e..91ddef7bfbf 100644
--- a/spec/lib/gitlab/ci/config/node/factory_spec.rb
+++ b/spec/lib/gitlab/ci/config/node/factory_spec.rb
@@ -5,7 +5,7 @@ describe Gitlab::Ci::Config::Node::Factory do
let(:factory) { described_class.new(entry_class) }
let(:entry_class) { Gitlab::Ci::Config::Node::Script }
- context 'when value setting value' do
+ context 'when setting up a value' do
it 'creates entry with valid value' do
entry = factory
.with(value: ['ls', 'pwd'])
@@ -35,9 +35,21 @@ describe Gitlab::Ci::Config::Node::Factory do
expect(entry.key).to eq 'test key'
end
end
+
+ context 'when setting a parent' do
+ let(:parent) { Object.new }
+
+ it 'creates entry with valid parent' do
+ entry = factory
+ .with(value: 'ls', parent: parent)
+ .create!
+
+ expect(entry.parent).to eq parent
+ end
+ end
end
- context 'when not setting value' do
+ context 'when not setting up a value' do
it 'raises error' do
expect { factory.create! }.to raise_error(
Gitlab::Ci::Config::Node::Factory::InvalidFactory