Commit b38c75b3 authored by Robert Speicher's avatar Robert Speicher

Correct more usages of non-relative `fixture_file_upload` paths

parent 6d165c74
...@@ -88,8 +88,7 @@ describe 'Project Jobs Permissions' do ...@@ -88,8 +88,7 @@ describe 'Project Jobs Permissions' do
describe 'artifacts page' do describe 'artifacts page' do
context 'when recent job has artifacts available' do context 'when recent job has artifacts available' do
before do before do
artifacts = Rails.root.join('spec/fixtures/ci_build_artifacts.zip') archive = fixture_file_upload('spec/fixtures/ci_build_artifacts.zip')
archive = fixture_file_upload(artifacts, 'application/zip')
job.update_attributes(legacy_artifacts_file: archive) job.update_attributes(legacy_artifacts_file: archive)
end end
......
...@@ -47,9 +47,7 @@ describe EmailsHelper do ...@@ -47,9 +47,7 @@ describe EmailsHelper do
describe '#header_logo' do describe '#header_logo' do
context 'there is a brand item with a logo' do context 'there is a brand item with a logo' do
it 'returns the brand header logo' do it 'returns the brand header logo' do
appearance = create :appearance, header_logo: fixture_file_upload( appearance = create :appearance, header_logo: fixture_file_upload('spec/fixtures/dk.png')
Rails.root.join('spec/fixtures/dk.png')
)
expect(header_logo).to eq( expect(header_logo).to eq(
%{<img style="height: 50px" src="/uploads/-/system/appearance/header_logo/#{appearance.id}/dk.png" alt="Dk" />} %{<img style="height: 50px" src="/uploads/-/system/appearance/header_logo/#{appearance.id}/dk.png" alt="Dk" />}
......
...@@ -4,9 +4,9 @@ describe GroupsHelper do ...@@ -4,9 +4,9 @@ describe GroupsHelper do
include ApplicationHelper include ApplicationHelper
describe 'group_icon' do describe 'group_icon' do
avatar_file_path = File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
it 'returns an url for the avatar' do it 'returns an url for the avatar' do
avatar_file_path = File.join('spec', 'fixtures', 'banana_sample.gif')
group = create(:group) group = create(:group)
group.avatar = fixture_file_upload(avatar_file_path) group.avatar = fixture_file_upload(avatar_file_path)
group.save! group.save!
...@@ -17,9 +17,9 @@ describe GroupsHelper do ...@@ -17,9 +17,9 @@ describe GroupsHelper do
end end
describe 'group_icon_url' do describe 'group_icon_url' do
avatar_file_path = File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
it 'returns an url for the avatar' do it 'returns an url for the avatar' do
avatar_file_path = File.join('spec', 'fixtures', 'banana_sample.gif')
group = create(:group) group = create(:group)
group.avatar = fixture_file_upload(avatar_file_path) group.avatar = fixture_file_upload(avatar_file_path)
group.save! group.save!
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe API::ProjectImport do describe API::ProjectImport do
let(:export_path) { "#{Dir.tmpdir}/project_export_spec" } let(:export_path) { "#{Dir.tmpdir}/project_export_spec" }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:file) { File.join(Rails.root, 'spec', 'features', 'projects', 'import_export', 'test_project_export.tar.gz') } let(:file) { File.join('spec', 'features', 'projects', 'import_export', 'test_project_export.tar.gz') }
let(:namespace) { create(:group) } let(:namespace) { create(:group) }
before do before do
allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path) allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path)
......
...@@ -10,7 +10,7 @@ describe Projects::UpdatePagesService do ...@@ -10,7 +10,7 @@ describe Projects::UpdatePagesService do
let(:file) { fixture_file_upload("spec/fixtures/pages.#{extension}") } let(:file) { fixture_file_upload("spec/fixtures/pages.#{extension}") }
let(:empty_file) { fixture_file_upload("spec/fixtures/pages_empty.#{extension}") } let(:empty_file) { fixture_file_upload("spec/fixtures/pages_empty.#{extension}") }
let(:metadata) do let(:metadata) do
filename = Rails.root + "spec/fixtures/pages.#{extension}.meta" filename = "spec/fixtures/pages.#{extension}.meta"
fixture_file_upload(filename) if File.exist?(filename) fixture_file_upload(filename) if File.exist?(filename)
end end
......
...@@ -62,7 +62,7 @@ describe GitlabUploader do ...@@ -62,7 +62,7 @@ describe GitlabUploader do
expect(FileUtils).to receive(:mv).with(anything, /^#{subject.work_dir}/).and_call_original expect(FileUtils).to receive(:mv).with(anything, /^#{subject.work_dir}/).and_call_original
expect(FileUtils).to receive(:mv).with(/^#{subject.work_dir}/, /#{subject.cache_dir}/).and_call_original expect(FileUtils).to receive(:mv).with(/^#{subject.work_dir}/, /#{subject.cache_dir}/).and_call_original
fixture = Rails.root.join('spec', 'fixtures', 'rails_sample.jpg') fixture = File.join('spec', 'fixtures', 'rails_sample.jpg')
subject.cache!(fixture_file_upload(fixture)) subject.cache!(fixture_file_upload(fixture))
expect(subject.file.path).to match(/#{subject.cache_dir}/) expect(subject.file.path).to match(/#{subject.cache_dir}/)
......
...@@ -29,8 +29,7 @@ describe JobArtifactUploader do ...@@ -29,8 +29,7 @@ describe JobArtifactUploader do
context 'when trace is stored in File storage' do context 'when trace is stored in File storage' do
context 'when file exists' do context 'when file exists' do
let(:file) do let(:file) do
fixture_file_upload( fixture_file_upload('spec/fixtures/trace/sample_trace', 'text/plain')
Rails.root.join('spec/fixtures/trace/sample_trace'), 'text/plain')
end end
before do before do
...@@ -63,8 +62,7 @@ describe JobArtifactUploader do ...@@ -63,8 +62,7 @@ describe JobArtifactUploader do
context 'file is stored in valid local_path' do context 'file is stored in valid local_path' do
let(:file) do let(:file) do
fixture_file_upload( fixture_file_upload('spec/fixtures/ci_build_artifacts.zip', 'application/zip')
Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), 'application/zip')
end end
before do before do
...@@ -81,7 +79,7 @@ describe JobArtifactUploader do ...@@ -81,7 +79,7 @@ describe JobArtifactUploader do
describe "#migrate!" do describe "#migrate!" do
before do before do
uploader.store!(fixture_file_upload(File.join('spec/fixtures/trace/sample_trace'))) uploader.store!(fixture_file_upload('spec/fixtures/trace/sample_trace'))
stub_artifacts_object_storage stub_artifacts_object_storage
end end
......
...@@ -44,8 +44,7 @@ describe LegacyArtifactUploader do ...@@ -44,8 +44,7 @@ describe LegacyArtifactUploader do
context 'file is stored in valid path' do context 'file is stored in valid path' do
let(:file) do let(:file) do
fixture_file_upload( fixture_file_upload('spec/fixtures/ci_build_artifacts.zip', 'application/zip')
Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), 'application/zip')
end end
before do before do
......
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