diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index 32a896cf..cbcf60e8 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -43,11 +43,13 @@ def extents_information physdesc_facet ].compact.join(", ") - if quantity_unittype.blank? + extent_info = if quantity_unittype.blank? dimensions_facet else [quantity_unittype, dimensions_facet].compact.join(", ") end + + extent_info.presence end def extract_notes_by_header(header) diff --git a/spec/models/solr_document_spec.rb b/spec/models/solr_document_spec.rb index 4e5ef44c..4a3af88f 100644 --- a/spec/models/solr_document_spec.rb +++ b/spec/models/solr_document_spec.rb @@ -108,8 +108,8 @@ document.extents_information end - it "returns an empty string" do - expect(extents_information_value).to eq "" + it "returns nil" do + expect(extents_information_value).to be_nil end end end