summaryrefslogtreecommitdiff
path: root/spec/support/helpers/stub_gitlab_calls.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-20 08:43:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-20 08:43:02 +0000
commitd9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch)
tree2341ef426af70ad1e289c38036737e04b0aa5007 /spec/support/helpers/stub_gitlab_calls.rb
parentd6e514dd13db8947884cd58fe2a9c2a063400a9b (diff)
downloadgitlab-ce-d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb.tar.gz
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'spec/support/helpers/stub_gitlab_calls.rb')
-rw-r--r--spec/support/helpers/stub_gitlab_calls.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/support/helpers/stub_gitlab_calls.rb b/spec/support/helpers/stub_gitlab_calls.rb
index 5ab778c11cb..6f530d57caf 100644
--- a/spec/support/helpers/stub_gitlab_calls.rb
+++ b/spec/support/helpers/stub_gitlab_calls.rb
@@ -79,6 +79,18 @@ module StubGitlabCalls
end
end
+ def stub_container_registry_info(info: {})
+ allow(ContainerRegistry::Client)
+ .to receive(:registry_info)
+ .and_return(info)
+ end
+
+ def stub_container_registry_network_error(client_method:)
+ allow_next_instance_of(ContainerRegistry::Client) do |client|
+ allow(client).to receive(client_method).and_raise(::Faraday::Error, nil, nil)
+ end
+ end
+
def stub_commonmark_sourcepos_disabled
allow_any_instance_of(Banzai::Filter::MarkdownEngines::CommonMark)
.to receive(:render_options)