diff options
Diffstat (limited to 'spec/models/lfs_object_spec.rb')
-rw-r--r-- | spec/models/lfs_object_spec.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/spec/models/lfs_object_spec.rb b/spec/models/lfs_object_spec.rb index 36d45f17392..a0f633218b0 100644 --- a/spec/models/lfs_object_spec.rb +++ b/spec/models/lfs_object_spec.rb @@ -152,14 +152,10 @@ RSpec.describe LfsObject do end describe 'file is being stored' do - let(:lfs_object) { create(:lfs_object, :with_file) } + subject { create(:lfs_object, :with_file) } 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 + it_behaves_like 'mounted file in local store' end context 'when direct upload is enabled' do @@ -167,13 +163,7 @@ RSpec.describe LfsObject do stub_lfs_object_storage(direct_upload: true) end - 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) - end - end + it_behaves_like 'mounted file in object store' end end end |