• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / allsearch_api / 7d3a0de1-6c4f-435c-a05a-b461e285fc5e

02 Jul 2025 06:25PM UTC coverage: 99.507% (+0.01%) from 99.494%
7d3a0de1-6c4f-435c-a05a-b461e285fc5e

Pull #381

circleci

sandbergja
Refactor RackResponseController so that subclasses don't need to implement #json

Co-authored-by: Christina Chortaria <christinach@users.noreply.github.com>
Pull Request #381: Rewrite DPUL and FindingAids controllers as rack applications

30 of 30 new or added lines in 3 files covered. (100.0%)

36 existing lines in 8 files now uncovered.

1009 of 1014 relevant lines covered (99.51%)

96.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/app/models/library_staff.rb
1
# frozen_string_literal: true
2

3
# This class is responsible for translating LibraryStaffRecords
4
# into an API response
5
class LibraryStaff
3✔
6
  include Parsed
3✔
7
  attr_reader :query_terms, :service_response
3✔
8

9
  def initialize(query_terms:)
3✔
10
    @query_terms = query_terms
20✔
11
    @service_response = library_staff_service_response
20✔
12
  end
13

14
  def library_staff_service_response
3✔
15
    unescaped_terms = URI::DEFAULT_PARSER.unescape(query_terms)
22✔
16
    LibraryStaffRecord.query(unescaped_terms)
22✔
17
  end
18

19
  def number
3✔
UNCOV
20
    service_response.count
18✔
21
  end
22

23
  def more_link
3✔
24
    URI::HTTPS.build(host: 'library.princeton.edu', path: '/about/staff-directory',
37✔
25
                     query: "combine=#{query_terms}")
26
  end
27

28
  def documents
3✔
UNCOV
29
    service_response.first(3)
18✔
30
  end
31
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc