2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Raw files', '(JavaScript fixtures)' do
|
2017-08-17 22:00:37 +05:30
|
|
|
include JavaScriptFixturesHelpers
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
let(:namespace) { create(:namespace, name: 'frontend-fixtures' ) }
|
2017-09-10 17:25:29 +05:30
|
|
|
let(:project) { create(:project, :repository, namespace: namespace, path: 'raw-project') }
|
2022-01-26 12:08:38 +05:30
|
|
|
let(:response) { @response }
|
|
|
|
|
|
|
|
def blob_at(commit, path)
|
|
|
|
@response = project.repository.blob_at(commit, path).data.force_encoding('UTF-8')
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
after do
|
|
|
|
remove_repository(project)
|
|
|
|
end
|
|
|
|
|
2019-09-04 21:01:54 +05:30
|
|
|
it 'blob/notebook/basic.json' do
|
2022-01-26 12:08:38 +05:30
|
|
|
blob_at('6d85bb69', 'files/ipython/basic.ipynb')
|
2019-09-04 21:01:54 +05:30
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
it 'blob/notebook/markdown-table.json' do
|
2022-01-26 12:08:38 +05:30
|
|
|
blob_at('f6b7a707', 'files/ipython/markdown-table.ipynb')
|
2021-06-08 01:23:25 +05:30
|
|
|
end
|
|
|
|
|
2019-09-04 21:01:54 +05:30
|
|
|
it 'blob/notebook/worksheets.json' do
|
2022-01-26 12:08:38 +05:30
|
|
|
blob_at('6d85bb69', 'files/ipython/worksheets.ipynb')
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2019-09-04 21:01:54 +05:30
|
|
|
it 'blob/notebook/math.json' do
|
2022-01-26 12:08:38 +05:30
|
|
|
blob_at('93ee732', 'files/ipython/math.ipynb')
|
2019-09-04 21:01:54 +05:30
|
|
|
end
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2019-09-04 21:01:54 +05:30
|
|
|
it 'blob/pdf/test.pdf' do
|
2022-01-26 12:08:38 +05:30
|
|
|
blob_at('e774ebd33', 'files/pdf/test.pdf')
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
2021-02-22 17:27:13 +05:30
|
|
|
|
|
|
|
it 'blob/text/README.md' do
|
2022-01-26 12:08:38 +05:30
|
|
|
blob_at('e774ebd33', 'README.md')
|
2021-02-22 17:27:13 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'blob/images/logo-white.png' do
|
2022-01-26 12:08:38 +05:30
|
|
|
blob_at('e774ebd33', 'files/images/logo-white.png')
|
2021-02-22 17:27:13 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'blob/binary/Gemfile.zip' do
|
2022-01-26 12:08:38 +05:30
|
|
|
blob_at('e774ebd33', 'Gemfile.zip')
|
2021-02-22 17:27:13 +05:30
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|