summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb b/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb
index 4a43e6c9a86..d1bd22e5573 100644
--- a/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/rules/rule_spec.rb
@@ -339,6 +339,22 @@ RSpec.describe Gitlab::Ci::Config::Entry::Rules::Rule do
end
end
end
+
+ context 'with an invalid variables' do
+ let(:config) do
+ { if: '$THIS == "that"', variables: 'hello' }
+ end
+
+ before do
+ subject.compose!
+ end
+
+ it { is_expected.not_to be_valid }
+
+ it 'returns an error about invalid variables:' do
+ expect(subject.errors).to include(/variables config should be a hash of key value pairs/)
+ end
+ end
end
context 'allow_failure: validation' do