Commit 831b8720 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch 'mrincon/improve-blob-fixture-spec-error-handling' into 'master'

Improve blob fixture spec error handling

See merge request gitlab-org/gitlab!75368
parents 9841f1c5 6e4ba611
...@@ -7,41 +7,45 @@ RSpec.describe 'Raw files', '(JavaScript fixtures)' do ...@@ -7,41 +7,45 @@ RSpec.describe 'Raw files', '(JavaScript fixtures)' do
let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} let(:namespace) { create(:namespace, name: 'frontend-fixtures' )}
let(:project) { create(:project, :repository, namespace: namespace, path: 'raw-project') } let(:project) { create(:project, :repository, namespace: namespace, path: 'raw-project') }
let(:response) { @blob.data.force_encoding('UTF-8') } let(:response) { @response }
def blob_at(commit, path)
@response = project.repository.blob_at(commit, path).data.force_encoding('UTF-8')
end
after do after do
remove_repository(project) remove_repository(project)
end end
it 'blob/notebook/basic.json' do it 'blob/notebook/basic.json' do
@blob = project.repository.blob_at('6d85bb69', 'files/ipython/basic.ipynb') blob_at('6d85bb69', 'files/ipython/basic.ipynb')
end end
it 'blob/notebook/markdown-table.json' do it 'blob/notebook/markdown-table.json' do
@blob = project.repository.blob_at('f6b7a707', 'files/ipython/markdown-table.ipynb') blob_at('f6b7a707', 'files/ipython/markdown-table.ipynb')
end end
it 'blob/notebook/worksheets.json' do it 'blob/notebook/worksheets.json' do
@blob = project.repository.blob_at('6d85bb69', 'files/ipython/worksheets.ipynb') blob_at('6d85bb69', 'files/ipython/worksheets.ipynb')
end end
it 'blob/notebook/math.json' do it 'blob/notebook/math.json' do
@blob = project.repository.blob_at('93ee732', 'files/ipython/math.ipynb') blob_at('93ee732', 'files/ipython/math.ipynb')
end end
it 'blob/pdf/test.pdf' do it 'blob/pdf/test.pdf' do
@blob = project.repository.blob_at('e774ebd33', 'files/pdf/test.pdf') blob_at('e774ebd33', 'files/pdf/test.pdf')
end end
it 'blob/text/README.md' do it 'blob/text/README.md' do
@blob = project.repository.blob_at('e774ebd33', 'README.md') blob_at('e774ebd33', 'README.md')
end end
it 'blob/images/logo-white.png' do it 'blob/images/logo-white.png' do
@blob = project.repository.blob_at('e774ebd33', 'files/images/logo-white.png') blob_at('e774ebd33', 'files/images/logo-white.png')
end end
it 'blob/binary/Gemfile.zip' do it 'blob/binary/Gemfile.zip' do
@blob = project.repository.blob_at('e774ebd33', 'Gemfile.zip') blob_at('e774ebd33', 'Gemfile.zip')
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment