diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-23 00:08:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-23 00:08:53 +0300 |
commit | 386dcdbe9d3cef9d5fa79c4582a722db27fe2c57 (patch) | |
tree | a0719a1794b21fedf33ab51a4052b8b9c0f7b573 /spec/lib/gitlab/github_gists_import/importer/gist_importer_spec.rb | |
parent | a9a2f9257eae40935e03ca4185d5263bcb7ba45f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/github_gists_import/importer/gist_importer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/github_gists_import/importer/gist_importer_spec.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/lib/gitlab/github_gists_import/importer/gist_importer_spec.rb b/spec/lib/gitlab/github_gists_import/importer/gist_importer_spec.rb index b098a151660..b64348d447b 100644 --- a/spec/lib/gitlab/github_gists_import/importer/gist_importer_spec.rb +++ b/spec/lib/gitlab/github_gists_import/importer/gist_importer_spec.rb @@ -167,13 +167,16 @@ RSpec.describe Gitlab::GithubGistsImport::Importer::GistImporter, feature_catego before do allow(::Gitlab::CurrentSettings) .to receive(:allow_local_requests_from_web_hooks_and_services?).and_return(true) + allow(::Gitlab::CurrentSettings) + .to receive(:deny_all_requests_except_allowed?).and_return(true) end it 'raises error' do - expect(Gitlab::UrlBlocker) + expect(Gitlab::HTTP_V2::UrlBlocker) .to receive(:validate!) .with(url, ports: [80, 443], schemes: %w[http https git], - allow_localhost: true, allow_local_network: true) + allow_localhost: true, allow_local_network: true, + deny_all_requests_except_allowed: true) .and_raise(Gitlab::HTTP_V2::UrlBlocker::BlockedUrlError) expect { subject.execute }.to raise_error(Gitlab::HTTP_V2::UrlBlocker::BlockedUrlError) @@ -184,13 +187,16 @@ RSpec.describe Gitlab::GithubGistsImport::Importer::GistImporter, feature_catego before do allow(::Gitlab::CurrentSettings) .to receive(:allow_local_requests_from_web_hooks_and_services?).and_return(false) + allow(::Gitlab::CurrentSettings) + .to receive(:deny_all_requests_except_allowed?).and_return(true) end it 'raises error' do - expect(Gitlab::UrlBlocker) + expect(Gitlab::HTTP_V2::UrlBlocker) .to receive(:validate!) .with(url, ports: [80, 443], schemes: %w[http https git], - allow_localhost: false, allow_local_network: false) + allow_localhost: false, allow_local_network: false, + deny_all_requests_except_allowed: true) .and_raise(Gitlab::HTTP_V2::UrlBlocker::BlockedUrlError) expect { subject.execute }.to raise_error(Gitlab::HTTP_V2::UrlBlocker::BlockedUrlError) |