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

pulibrary / allsearch_api / ed1cefda-f43b-4b58-95dd-12a33b7f1f7a

02 Jul 2025 06:23PM UTC coverage: 96.252% (-3.2%) from 99.494%
ed1cefda-f43b-4b58-95dd-12a33b7f1f7a

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

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

94 existing lines in 20 files now uncovered.

976 of 1014 relevant lines covered (96.25%)

63.21 hits per line

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

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

3
# This class is responsible for getting relevant
4
# metadata from the Summon::Documents
5
class ArticleDocument < Document
2✔
6
  delegate :abstract, to: :document
2✔
7
  delegate :end_page, to: :document
2✔
8
  delegate :issue, to: :document
2✔
9
  delegate :publication_title, to: :document
2✔
10
  delegate :publisher, to: :document
2✔
11
  delegate :start_page, to: :document
2✔
12
  delegate :volume, to: :document
2✔
13

14
  def title
2✔
UNCOV
15
    sanitize document.title
30✔
16
  end
17

18
  def creator
2✔
UNCOV
19
    document&.authors&.first&.fullname
30✔
20
  end
21

22
  def id
2✔
UNCOV
23
    document.src['DOI']&.first
30✔
24
  end
25

26
  def type
2✔
UNCOV
27
    document.content_type
30✔
28
  end
29

30
  # NOTE: the Snippet includes html to emphasize the relevant term, e.g.
31
  # In 1994, the Government of Cameroon introduced an array of <h>forest</h> policy reforms
32
  def description
2✔
UNCOV
33
    sanitize document.snippet
30✔
34
  end
35

36
  def url
2✔
UNCOV
37
    document.link
30✔
38
  end
39

40
  def doc_keys
2✔
UNCOV
41
    [:publication_date, :publication_year, :start_page, :end_page, :fulltext_available, :abstract,
30✔
42
     :publication_title, :volume, :issue, :isxn]
43
  end
44

45
  def fulltext_available
2✔
UNCOV
46
    document.fulltext ? 'Full-text available' : nil
30✔
47
  end
48

49
  def isxn
2✔
UNCOV
50
    (isbn + issn).compact.first
30✔
51
  end
52

53
  def isbn
2✔
UNCOV
54
    document.src['ISBN'].presence || []
30✔
55
  end
56

57
  def issn
2✔
UNCOV
58
    document.src['ISSN'].presence || []
30✔
59
  end
60

61
  def publication_date
2✔
UNCOV
62
    document.publication_date.text
30✔
63
  end
64

65
  def publication_year
2✔
UNCOV
66
    document.publication_date.year.to_s
30✔
67
  end
68
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