Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/ci/config/external/file/local_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config/external/file/local_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/external/file/local_spec.rb b/spec/lib/gitlab/ci/config/external/file/local_spec.rb
index 3d1fc32a62d..dec3eebe7b1 100644
--- a/spec/lib/gitlab/ci/config/external/file/local_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/file/local_spec.rb
@@ -81,6 +81,16 @@ RSpec.describe Gitlab::Ci::Config::External::File::Local do
expect(local_file.valid?).to be_falsy
end
end
+
+ context 'when the given sha is not valid' do
+ let(:location) { '/lib/gitlab/ci/templates/existent-file.yml' }
+ let(:sha) { ':' }
+
+ it 'returns false and adds an error message stating that included file does not exist' do
+ expect(local_file).not_to be_valid
+ expect(local_file.errors).to include("Sha #{sha} is not valid!")
+ end
+ end
end
describe '#content' do