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

pulibrary / pdc_discovery / a127fe22-c660-46bf-898d-03a7863fa8fb

pending completion
a127fe22-c660-46bf-898d-03a7863fa8fb

Pull #466

circleci

hectorcorrea
Adjust the test to account for the new author formatting
Pull Request #466: Display author affiliation (for PDC Describe records)

49 of 49 new or added lines in 5 files covered. (100.0%)

2265 of 2353 relevant lines covered (96.26%)

187.04 hits per line

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

78.95
/app/models/author.rb
1
# frozen_string_literal: true
2

3
class Author
1✔
4
  attr_reader :value, :name_type, :given_name, :family_name, :identifier, :affiliation, :sequence
1✔
5
  def initialize(hash)
1✔
6
    @value = hash["value"]
83✔
7
    @name_type = hash["name_type"]
83✔
8
    @given_name = hash["given_name"]
83✔
9
    @family_name = hash["family_name"]
83✔
10
    @identifier = hash["identifier"]
83✔
11
    @affiliation = hash["affiliations"] ? hash["affiliations"].first : nil
83✔
12
    @sequence = hash["sequence"] || 0
83✔
13
  end
14

15
  def affiliation_name
1✔
16
    @affiliation&.fetch("value", nil)
332✔
17
  end
18

19
  def affiliation_index
1✔
20
    if @affiliation
×
21
      @affiliation.fetch("index", 0)
×
22
    else
23
      0
×
24
    end
25
  end
26

27
  def affiliation_index=(index)
1✔
28
    if @affiliation
83✔
29
      @affiliation["index"] = index
×
30
    end
31
  end
32
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