summaryrefslogtreecommitdiff
path: root/spec/uploaders
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-06-11 09:59:25 +0000
committerRémy Coutable <remy@rymai.me>2018-06-11 09:59:25 +0000
commit7d3bbeeb31731907456e8c4d5640e52e58a921fb (patch)
treee6495c453cf449b8aa87845ec818798405323b9f /spec/uploaders
parenta4f37e1834dbd755981b0ce19617e99b4ea43bb7 (diff)
parentb38c75b3dc2dc655377a1b4070cb6f5242594dbe (diff)
downloadgitlab-ce-7d3bbeeb31731907456e8c4d5640e52e58a921fb.tar.gz
Merge branch 'rs-update-rspec' into 'master'
Update rspec to 3.7 See merge request gitlab-org/gitlab-ce!19449
Diffstat (limited to 'spec/uploaders')
-rw-r--r--spec/uploaders/attachment_uploader_spec.rb2
-rw-r--r--spec/uploaders/file_mover_spec.rb2
-rw-r--r--spec/uploaders/file_uploader_spec.rb2
-rw-r--r--spec/uploaders/gitlab_uploader_spec.rb2
-rw-r--r--spec/uploaders/job_artifact_uploader_spec.rb8
-rw-r--r--spec/uploaders/legacy_artifact_uploader_spec.rb3
-rw-r--r--spec/uploaders/namespace_file_uploader_spec.rb2
-rw-r--r--spec/uploaders/object_storage_spec.rb2
-rw-r--r--spec/uploaders/personal_file_uploader_spec.rb2
-rw-r--r--spec/uploaders/records_uploads_spec.rb2
-rw-r--r--spec/uploaders/uploader_helper_spec.rb2
11 files changed, 13 insertions, 16 deletions
diff --git a/spec/uploaders/attachment_uploader_spec.rb b/spec/uploaders/attachment_uploader_spec.rb
index d302c14efb9..a9415854d25 100644
--- a/spec/uploaders/attachment_uploader_spec.rb
+++ b/spec/uploaders/attachment_uploader_spec.rb
@@ -26,7 +26,7 @@ describe AttachmentUploader do
describe "#migrate!" do
before do
- uploader.store!(fixture_file_upload(Rails.root.join('spec/fixtures/doc_sample.txt')))
+ uploader.store!(fixture_file_upload(File.join('spec/fixtures/doc_sample.txt')))
stub_uploads_object_storage
end
diff --git a/spec/uploaders/file_mover_spec.rb b/spec/uploaders/file_mover_spec.rb
index 68b7e24776d..de29d0c943f 100644
--- a/spec/uploaders/file_mover_spec.rb
+++ b/spec/uploaders/file_mover_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe FileMover do
let(:filename) { 'banana_sample.gif' }
- let(:file) { fixture_file_upload(Rails.root.join('spec', 'fixtures', filename)) }
+ let(:file) { fixture_file_upload(File.join('spec', 'fixtures', filename)) }
let(:temp_file_path) { File.join('uploads/-/system/temp', 'secret55', filename) }
let(:temp_description) do
diff --git a/spec/uploaders/file_uploader_spec.rb b/spec/uploaders/file_uploader_spec.rb
index db2810bbe1d..59013a02938 100644
--- a/spec/uploaders/file_uploader_spec.rb
+++ b/spec/uploaders/file_uploader_spec.rb
@@ -89,7 +89,7 @@ describe FileUploader do
describe "#migrate!" do
before do
- uploader.store!(fixture_file_upload(Rails.root.join('spec/fixtures/dk.png')))
+ uploader.store!(fixture_file_upload('spec/fixtures/dk.png'))
stub_uploads_object_storage
end
diff --git a/spec/uploaders/gitlab_uploader_spec.rb b/spec/uploaders/gitlab_uploader_spec.rb
index 4fba122cce1..362f89424d4 100644
--- a/spec/uploaders/gitlab_uploader_spec.rb
+++ b/spec/uploaders/gitlab_uploader_spec.rb
@@ -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(/^#{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))
expect(subject.file.path).to match(/#{subject.cache_dir}/)
diff --git a/spec/uploaders/job_artifact_uploader_spec.rb b/spec/uploaders/job_artifact_uploader_spec.rb
index 42036d67f3d..026e4356ed6 100644
--- a/spec/uploaders/job_artifact_uploader_spec.rb
+++ b/spec/uploaders/job_artifact_uploader_spec.rb
@@ -29,8 +29,7 @@ describe JobArtifactUploader do
context 'when trace is stored in File storage' do
context 'when file exists' do
let(:file) do
- fixture_file_upload(
- Rails.root.join('spec/fixtures/trace/sample_trace'), 'text/plain')
+ fixture_file_upload('spec/fixtures/trace/sample_trace', 'text/plain')
end
before do
@@ -63,8 +62,7 @@ describe JobArtifactUploader do
context 'file is stored in valid local_path' do
let(:file) do
- fixture_file_upload(
- Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), 'application/zip')
+ fixture_file_upload('spec/fixtures/ci_build_artifacts.zip', 'application/zip')
end
before do
@@ -81,7 +79,7 @@ describe JobArtifactUploader do
describe "#migrate!" do
before do
- uploader.store!(fixture_file_upload(Rails.root.join('spec/fixtures/trace/sample_trace')))
+ uploader.store!(fixture_file_upload('spec/fixtures/trace/sample_trace'))
stub_artifacts_object_storage
end
diff --git a/spec/uploaders/legacy_artifact_uploader_spec.rb b/spec/uploaders/legacy_artifact_uploader_spec.rb
index eeb6fd90c9d..0589563b502 100644
--- a/spec/uploaders/legacy_artifact_uploader_spec.rb
+++ b/spec/uploaders/legacy_artifact_uploader_spec.rb
@@ -44,8 +44,7 @@ describe LegacyArtifactUploader do
context 'file is stored in valid path' do
let(:file) do
- fixture_file_upload(
- Rails.root.join('spec/fixtures/ci_build_artifacts.zip'), 'application/zip')
+ fixture_file_upload('spec/fixtures/ci_build_artifacts.zip', 'application/zip')
end
before do
diff --git a/spec/uploaders/namespace_file_uploader_spec.rb b/spec/uploaders/namespace_file_uploader_spec.rb
index a8ba01d70b8..71fe2c353c0 100644
--- a/spec/uploaders/namespace_file_uploader_spec.rb
+++ b/spec/uploaders/namespace_file_uploader_spec.rb
@@ -28,7 +28,7 @@ describe NamespaceFileUploader do
describe "#migrate!" do
before do
- uploader.store!(fixture_file_upload(Rails.root.join('spec/fixtures/doc_sample.txt')))
+ uploader.store!(fixture_file_upload(File.join('spec/fixtures/doc_sample.txt')))
stub_uploads_object_storage
end
diff --git a/spec/uploaders/object_storage_spec.rb b/spec/uploaders/object_storage_spec.rb
index 4503288e410..0bc5b6751b3 100644
--- a/spec/uploaders/object_storage_spec.rb
+++ b/spec/uploaders/object_storage_spec.rb
@@ -571,7 +571,7 @@ describe ObjectStorage do
context 'when local file is used' do
context 'when valid file is used' do
let(:uploaded_file) do
- fixture_file_upload(Rails.root + 'spec/fixtures/rails_sample.jpg', 'image/jpg')
+ fixture_file_upload('spec/fixtures/rails_sample.jpg', 'image/jpg')
end
it "properly caches the file" do
diff --git a/spec/uploaders/personal_file_uploader_spec.rb b/spec/uploaders/personal_file_uploader_spec.rb
index c70521d90dc..7700b14ce6b 100644
--- a/spec/uploaders/personal_file_uploader_spec.rb
+++ b/spec/uploaders/personal_file_uploader_spec.rb
@@ -45,7 +45,7 @@ describe PersonalFileUploader do
describe "#migrate!" do
before do
- uploader.store!(fixture_file_upload(Rails.root.join('spec/fixtures/doc_sample.txt')))
+ uploader.store!(fixture_file_upload('spec/fixtures/doc_sample.txt'))
stub_uploads_object_storage
end
diff --git a/spec/uploaders/records_uploads_spec.rb b/spec/uploaders/records_uploads_spec.rb
index 9a3e5d83e01..3592a11360d 100644
--- a/spec/uploaders/records_uploads_spec.rb
+++ b/spec/uploaders/records_uploads_spec.rb
@@ -16,7 +16,7 @@ describe RecordsUploads do
end
def upload_fixture(filename)
- fixture_file_upload(Rails.root.join('spec', 'fixtures', filename))
+ fixture_file_upload(File.join('spec', 'fixtures', filename))
end
describe 'callbacks' do
diff --git a/spec/uploaders/uploader_helper_spec.rb b/spec/uploaders/uploader_helper_spec.rb
index c47f09adb6d..33da93cc9d0 100644
--- a/spec/uploaders/uploader_helper_spec.rb
+++ b/spec/uploaders/uploader_helper_spec.rb
@@ -12,7 +12,7 @@ describe UploaderHelper do
end
def upload_fixture(filename)
- fixture_file_upload(Rails.root.join('spec', 'fixtures', filename))
+ fixture_file_upload(File.join('spec', 'fixtures', filename))
end
describe '#image_or_video?' do