diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-17 18:10:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-17 18:10:28 +0300 |
commit | a331169e6e84f93fd9b841b56465ac113b6d03f9 (patch) | |
tree | 1e823b05f484f55a5f7663b9aa580b64f6c6e0fd /spec/support | |
parent | c609c898ff7f42c3d72a1c6d619e1ff786f5e18a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/stub_gitlab_calls.rb | 9 | ||||
-rw-r--r-- | spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/spec/support/helpers/stub_gitlab_calls.rb b/spec/support/helpers/stub_gitlab_calls.rb index 6f530d57caf..ef3c39c83c2 100644 --- a/spec/support/helpers/stub_gitlab_calls.rb +++ b/spec/support/helpers/stub_gitlab_calls.rb @@ -92,9 +92,16 @@ module StubGitlabCalls end def stub_commonmark_sourcepos_disabled + render_options = + if Feature.enabled?(:use_cmark_renderer) + Banzai::Filter::MarkdownEngines::CommonMark::RENDER_OPTIONS_C + else + Banzai::Filter::MarkdownEngines::CommonMark::RENDER_OPTIONS_RUBY + end + allow_any_instance_of(Banzai::Filter::MarkdownEngines::CommonMark) .to receive(:render_options) - .and_return(Banzai::Filter::MarkdownEngines::CommonMark::RENDER_OPTIONS) + .and_return(render_options) end private diff --git a/spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb b/spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb index ed6d9ed43c8..06c51add438 100644 --- a/spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb @@ -167,7 +167,7 @@ end RSpec.shared_examples 'rejects PyPI access with unknown project id' do context 'with an unknown project' do - let(:project) { OpenStruct.new(id: 1234567890) } + let(:project) { double('access', id: 1234567890) } it_behaves_like 'unknown PyPI scope id' end @@ -175,7 +175,7 @@ end RSpec.shared_examples 'rejects PyPI access with unknown group id' do context 'with an unknown project' do - let(:group) { OpenStruct.new(id: 1234567890) } + let(:group) { double('access', id: 1234567890) } it_behaves_like 'unknown PyPI scope id' end |