diff --git a/app/models/collection_branding_info.rb b/app/models/collection_branding_info.rb index 7f3b880b08..96823ca827 100644 --- a/app/models/collection_branding_info.rb +++ b/app/models/collection_branding_info.rb @@ -19,7 +19,7 @@ def save(file_location, upload_file = true) super() end - def delete(location_path = nil) + def delete(_location_path = nil) storage.delete(id: local_path) end diff --git a/spec/models/collection_branding_info_spec.rb b/spec/models/collection_branding_info_spec.rb index 9f12c7814c..ea6135a73a 100644 --- a/spec/models/collection_branding_info_spec.rb +++ b/spec/models/collection_branding_info_spec.rb @@ -55,9 +55,13 @@ before { banner_info.save(file.path) } it "removes banner file" do - expect { banner_info.delete } - .to change { storage_adapter.find_by(id: banner_info.local_path) } - .to raise_error Valkyrie::StorageAdapter::FileNotFound + expect { banner_info.delete }.to change { + begin + storage_adapter.find_by(id: banner_info.local_path) + rescue Valkyrie::StorageAdapter::FileNotFound + 'Raised FileNotFound' # Convert the raised error so change can detect it + end + }.from(be_a(Valkyrie::StorageAdapter::File)).to(eq 'Raised FileNotFound') end end end