Skip to content

Commit

Permalink
Merge pull request #3837 from sul-dlss/courses
Browse files Browse the repository at this point in the history
Add accessor for the course data
  • Loading branch information
marlo-longley authored Jan 31, 2024
2 parents 84ded0a + d327a65 commit f139ff7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/services/folio/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def campuses
@campuses ||= get_type('campuses').index_by { |p| p['id'] }
end

def courses
@courses ||= get_type('courses').index_by { |p| p['id'] }
end

def libraries
@libraries ||= get_type('libraries').index_by { |p| p['id'] }
end
Expand Down
6 changes: 6 additions & 0 deletions spec/services/folio/types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
end
end

describe '.courses' do
it 'returns the course reserves' do
expect(described_class.courses.values).to all(have_key('courseListingObject'))
end
end

describe '#sync!' do
subject(:instance) { described_class.new(cache_dir: Pathname.new(tmpdir), folio_client:) }

Expand Down

0 comments on commit f139ff7

Please sign in to comment.