diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 18:06:53 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 18:06:53 +0000 |
commit | 143f196f8b3c40ceb7e9335a8dcc712b079519b9 (patch) | |
tree | 909df13e1f99b456287934741ba466b506e01129 /spec/support/helpers/stub_gitlab_calls.rb | |
parent | 575ccb036ea14c6a899482a83bd985ffbc992077 (diff) | |
download | gitlab-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.rb | 9 |
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) |