summaryrefslogtreecommitdiff
path: root/spec/models/lfs_object_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/lfs_object_spec.rb')
-rw-r--r--spec/models/lfs_object_spec.rb44
1 files changed, 22 insertions, 22 deletions
diff --git a/spec/models/lfs_object_spec.rb b/spec/models/lfs_object_spec.rb
index 3f929710862..40782a03bbf 100644
--- a/spec/models/lfs_object_spec.rb
+++ b/spec/models/lfs_object_spec.rb
@@ -1,59 +1,59 @@
-require 'spec_helper'
+require "spec_helper"
describe LfsObject do
- describe '#local_store?' do
- it 'returns true when file_store is equal to LfsObjectUploader::Store::LOCAL' do
+ describe "#local_store?" do
+ it "returns true when file_store is equal to LfsObjectUploader::Store::LOCAL" do
subject.file_store = LfsObjectUploader::Store::LOCAL
expect(subject.local_store?).to eq true
end
- it 'returns false when file_store is equal to LfsObjectUploader::Store::REMOTE' do
+ it "returns false when file_store is equal to LfsObjectUploader::Store::REMOTE" do
subject.file_store = LfsObjectUploader::Store::REMOTE
expect(subject.local_store?).to eq false
end
end
- describe '#schedule_background_upload' do
+ describe "#schedule_background_upload" do
before do
stub_lfs_setting(enabled: true)
end
subject { create(:lfs_object, :with_file) }
- context 'when object storage is disabled' do
+ context "when object storage is disabled" do
before do
stub_lfs_object_storage(enabled: false)
end
- it 'does not schedule the migration' do
+ it "does not schedule the migration" do
expect(ObjectStorage::BackgroundMoveWorker).not_to receive(:perform_async)
subject
end
end
- context 'when object storage is enabled' do
- context 'when background upload is enabled' do
- context 'when is licensed' do
+ context "when object storage is enabled" do
+ context "when background upload is enabled" do
+ context "when is licensed" do
before do
stub_lfs_object_storage(background_upload: true)
end
- it 'schedules the model for migration' do
+ it "schedules the model for migration" do
expect(ObjectStorage::BackgroundMoveWorker)
.to receive(:perform_async)
- .with('LfsObjectUploader', described_class.name, :file, kind_of(Numeric))
+ .with("LfsObjectUploader", described_class.name, :file, kind_of(Numeric))
.once
subject
end
- it 'schedules the model for migration once' do
+ it "schedules the model for migration once" do
expect(ObjectStorage::BackgroundMoveWorker)
.to receive(:perform_async)
- .with('LfsObjectUploader', described_class.name, :file, kind_of(Numeric))
+ .with("LfsObjectUploader", described_class.name, :file, kind_of(Numeric))
.once
create(:lfs_object, :with_file)
@@ -61,12 +61,12 @@ describe LfsObject do
end
end
- context 'when background upload is disabled' do
+ context "when background upload is disabled" do
before do
stub_lfs_object_storage(background_upload: false)
end
- it 'schedules the model for migration' do
+ it "schedules the model for migration" do
expect(ObjectStorage::BackgroundMoveWorker).not_to receive(:perform_async)
subject
@@ -74,24 +74,24 @@ describe LfsObject do
end
end
- describe 'file is being stored' do
+ describe "file is being stored" do
let(:lfs_object) { create(:lfs_object, :with_file) }
- context 'when existing object has local store' do
- it 'is stored locally' do
+ context "when existing object has local store" do
+ it "is stored locally" do
expect(lfs_object.file_store).to be(ObjectStorage::Store::LOCAL)
expect(lfs_object.file).to be_file_storage
expect(lfs_object.file.object_store).to eq(ObjectStorage::Store::LOCAL)
end
end
- context 'when direct upload is enabled' do
+ context "when direct upload is enabled" do
before do
stub_lfs_object_storage(direct_upload: true)
end
- context 'when file is stored' do
- it 'is stored remotely' do
+ context "when file is stored" do
+ it "is stored remotely" do
expect(lfs_object.file_store).to eq(ObjectStorage::Store::REMOTE)
expect(lfs_object.file).not_to be_file_storage
expect(lfs_object.file.object_store).to eq(ObjectStorage::Store::REMOTE)