diff options
Diffstat (limited to 'spec/lib/gitlab/ci/yaml_processor_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/yaml_processor_spec.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb index b7b30e60d44..f4b224ae551 100644 --- a/spec/lib/gitlab/ci/yaml_processor_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb @@ -626,8 +626,8 @@ module Gitlab context "when an array is provided" do let(:include_content) { ["/local.gitlab-ci.yml"] } - it "does not return any error" do - expect { subject }.not_to raise_error + it "returns a validation error" do + expect { subject }.to raise_error(Gitlab::Ci::YamlProcessor::ValidationError, /does not have project/) end end @@ -643,11 +643,18 @@ module Gitlab let(:include_content) do [ 'https://gitlab.com/awesome-project/raw/master/.before-script-template.yml', - '/templates/.after-script-template.yml', { template: 'Auto-DevOps.gitlab-ci.yml' } ] end + before do + WebMock.stub_request(:get, 'https://gitlab.com/awesome-project/raw/master/.before-script-template.yml') + .to_return( + status: 200, + headers: { 'Content-Type' => 'application/json' }, + body: 'prepare: { script: ls -al }') + end + it "does not return any error" do expect { subject }.not_to raise_error end |