Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LIBSEARCH-1032] Test an integration of book covers from Syndetic Solutions in the shelf carousel #137

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/models/carousel_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ def call_number
@browse_doc["callnumber"]&.strip
end

def isbn
@catalog_doc["isbn"]&.first&.strip
end

def issn
@catalog_doc["issn"]&.first&.strip
end

def oclc
@catalog_doc["oclc"]&.first&.strip
end

def mms_id
@browse_doc["bib_id"]
end
Expand All @@ -52,6 +64,9 @@ def to_h
author: author,
date: date,
call_number: call_number,
isbn: isbn,
issn: issn,
oclc: oclc,
url: url
}
end
Expand Down
12 changes: 12 additions & 0 deletions spec/models/carousel_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ def body(file_name)
it "has a call_number" do
expect(subject.call_number).to eq("Z 253 .U6 1963")
end
it "has an isbn" do
expect(subject.isbn).to eq(nil)
end
it "has an issn" do
expect(subject.issn).to eq(nil)
end
erinesullivan marked this conversation as resolved.
Show resolved Hide resolved
it "has an oclc" do
expect(subject.oclc).to eq("2497305")
end
it "has an mms_id" do
expect(subject.mms_id).to eq("990011613060106381")
end
Expand All @@ -49,6 +58,9 @@ def body(file_name)
author: "United States. Government Printing Office",
call_number: "Z 253 .U6 1963",
date: "1950",
isbn: nil,
issn: nil,
oclc: "2497305",
title: "Theory and practice of composition.",
url: "#{S.search_url}/catalog/record/990011613060106381"

Expand Down
Loading