summaryrefslogtreecommitdiff
path: root/spec/support/helpers/stub_gitlab_calls.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-18 18:06:53 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-18 18:06:53 +0000
commit143f196f8b3c40ceb7e9335a8dcc712b079519b9 (patch)
tree909df13e1f99b456287934741ba466b506e01129 /spec/support/helpers/stub_gitlab_calls.rb
parent575ccb036ea14c6a899482a83bd985ffbc992077 (diff)
downloadgitlab-ce-143f196f8b3c40ceb7e9335a8dcc712b079519b9.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers/stub_gitlab_calls.rb')
-rw-r--r--spec/support/helpers/stub_gitlab_calls.rb9
1 files changed, 7 insertions, 2 deletions
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)