Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
hooked up liblocdisplay to alma holdings
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Apr 19, 2021
1 parent e06e40e commit cd71cae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 12 additions & 1 deletion lib/spectrum/holding/alma_holdings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,19 @@ def holding_id
def callnumber
@holding["call_number"]
end
def location_text
Spectrum::LibLocDisplay.text(library, location)
end
def location_link
Spectrum::LibLocDisplay.link(library, location)
end


def library
@items.first&.library
end
def location
@items.first&.location
end
end
class Spectrum::AlmaItem
extend Forwardable
Expand Down
13 changes: 10 additions & 3 deletions spec/spectrum/holding/alma_holdings_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative '../../spec_helper'
require 'spectrum/holding/alma_holdings'
require 'spectrum/lib_loc_display'
describe Spectrum::AlmaHoldings do
before(:each) do
@mms_id = "990020578280206381"
Expand Down Expand Up @@ -40,6 +41,9 @@
end
end
describe Spectrum::AlmaHolding do
before(:each) do
Spectrum::LibLocDisplay.configure('spec/fixtures/lib_loc_display.json')
end
subject do
response = JSON.parse(File.read('./spec/fixtures/alma_one_holding.json'))
bib = instance_double(Spectrum::AlmaBib, title: "title")
Expand All @@ -51,9 +55,12 @@
it "has holding_id" do
expect(subject.holding_id).to eq("2297537770006381")
end
#it "has full_location_description" do
#expect(subject.full_location_description).to eq("")
#end
it "has location_text" do
expect(subject.location_text).to eq("Hatcher Graduate")
end
it "has location_link" do
expect(subject.location_link).to eq("http://www.lib.umich.edu/location/hatcher-graduate-library/unit/25")
end
it "has a call number" do
expect(subject.callnumber).to eq("LB 2331.72 .S371 1990")
end
Expand Down

0 comments on commit cd71cae

Please sign in to comment.