diff options
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/include_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/include_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/include_spec.rb b/spec/lib/gitlab/ci/config/entry/include_spec.rb index 3e816f70c03..59f0b0e7a48 100644 --- a/spec/lib/gitlab/ci/config/entry/include_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/include_spec.rb @@ -61,6 +61,31 @@ RSpec.describe ::Gitlab::Ci::Config::Entry::Include do end end end + + context 'when using "project"' do + context 'and specifying "ref" and "file"' do + let(:config) { { project: 'my-group/my-pipeline-library', ref: 'master', file: 'test.yml' } } + + it { is_expected.to be_valid } + end + + context 'without "ref"' do + let(:config) { { project: 'my-group/my-pipeline-library', file: 'test.yml' } } + + it { is_expected.to be_valid } + end + + context 'without "file"' do + let(:config) { { project: 'my-group/my-pipeline-library' } } + + it { is_expected.not_to be_valid } + + it 'has specific error' do + expect(include_entry.errors) + .to include('include config must specify the file where to fetch the config from') + end + end + end end context 'when value is something else' do |