Skip to content

Commit

Permalink
Merge pull request #96 from mlibrary/query-error
Browse files Browse the repository at this point in the history
fix: callnumber browse items without a catlog record
  • Loading branch information
niquerio authored Jul 24, 2023
2 parents ebc7c69 + 48b49d1 commit 81f9917
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/models/callnumber_item.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CallnumberItem
def initialize(browse_doc:, catalog_doc:, exact_match:)
@browse_doc = browse_doc
@catalog_doc = catalog_doc
@catalog_doc = catalog_doc || {}
@exact_match = exact_match
end

Expand Down
4 changes: 4 additions & 0 deletions spec/models/callnumber_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
@catalog_doc["edition"] = ["my edition", "vernacular edition"]
expect(subject.title).to eq("Zhiznʹ gospodina de Molʹera / M. Bulgakov ; [podgot. teksta i poslesl. V.I. Loseva]. my edition")
end
it "is an empty string when there is no matching catalog record" do
@catalog_doc = nil
expect(subject.title).to eq("")
end
end
context "#vernacular_title" do
it "shows vernacular title without edition when there isn't one" do
Expand Down

0 comments on commit 81f9917

Please sign in to comment.