From 143f196f8b3c40ceb7e9335a8dcc712b079519b9 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 18 Nov 2019 18:06:53 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/support/helpers/stub_gitlab_calls.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'spec/support/helpers/stub_gitlab_calls.rb') diff --git a/spec/support/helpers/stub_gitlab_calls.rb b/spec/support/helpers/stub_gitlab_calls.rb index e3dde888277..fe343da7838 100644 --- a/spec/support/helpers/stub_gitlab_calls.rb +++ b/spec/support/helpers/stub_gitlab_calls.rb @@ -18,8 +18,13 @@ module StubGitlabCalls stub_ci_pipeline_yaml_file(gitlab_ci_yaml) end - def stub_ci_pipeline_yaml_file(ci_yaml) - allow_any_instance_of(Ci::Pipeline).to receive(:ci_yaml_file) { ci_yaml } + def stub_ci_pipeline_yaml_file(ci_yaml_content) + allow_any_instance_of(Repository).to receive(:gitlab_ci_yml_for).and_return(ci_yaml_content) + + # Ensure we don't hit auto-devops when config not found in repository + unless ci_yaml_content + allow_any_instance_of(Project).to receive(:auto_devops_enabled?).and_return(false) + end end def stub_pipeline_modified_paths(pipeline, modified_paths) -- cgit v1.2.1