diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/presenters/blob_presenter_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/presenters/blob_presenter_spec.rb')
-rw-r--r-- | spec/presenters/blob_presenter_spec.rb | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/spec/presenters/blob_presenter_spec.rb b/spec/presenters/blob_presenter_spec.rb index 80e08db6099..7b7463e6abc 100644 --- a/spec/presenters/blob_presenter_spec.rb +++ b/spec/presenters/blob_presenter_spec.rb @@ -250,45 +250,6 @@ RSpec.describe BlobPresenter do presenter.highlight end end - - context 'when blob is ipynb' do - let(:blob) { repository.blob_at('f6b7a707', 'files/ipython/markdown-table.ipynb') } - let(:git_blob) { blob.__getobj__ } - - before do - allow(Gitlab::Diff::CustomDiff).to receive(:transformed_for_diff?).and_return(true) - end - - it 'uses md as the transformed language' do - expect(Gitlab::Highlight).to receive(:highlight).with('files/ipython/markdown-table.ipynb', anything, plain: nil, language: 'md') - - presenter.highlight - end - - it 'transforms the blob' do - expect(Gitlab::Highlight).to receive(:highlight).with('files/ipython/markdown-table.ipynb', include("%%"), plain: nil, language: 'md') - - presenter.highlight - end - end - - context 'when blob is other file type' do - let(:git_blob) { blob.__getobj__ } - - before do - allow(git_blob) - .to receive(:data) - .and_return("line one\nline two\nline 3") - - allow(blob).to receive(:language_from_gitattributes).and_return('ruby') - end - - it 'does not transform the file' do - expect(Gitlab::Highlight).to receive(:highlight).with('files/ruby/regex.rb', git_blob.data, plain: nil, language: 'ruby') - - presenter.highlight - end - end end describe '#blob_language' do @@ -304,16 +265,6 @@ RSpec.describe BlobPresenter do it { is_expected.to eq('cpp') } end - context 'when blob is ipynb' do - let(:blob) { repository.blob_at('f6b7a707', 'files/ipython/markdown-table.ipynb') } - - before do - allow(Gitlab::Diff::CustomDiff).to receive(:transformed_for_diff?).and_return(true) - end - - it { is_expected.to eq('md') } - end - context 'when blob is binary' do let(:blob) { repository.blob_at('HEAD', 'Gemfile.zip') } |