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

pulibrary / orcid_princeton_hanami / 2bb26096-1bd1-42ca-a18d-a6dd2d362ec0

23 Jul 2025 04:49PM UTC coverage: 99.194% (-0.4%) from 99.589%
2bb26096-1bd1-42ca-a18d-a6dd2d362ec0

push

circleci

carolyncole
Integrating jbuilder with Tilt to correctly produce the user json
https://discourse.hanamirb.org/t/tilt-json-example/1280/3

11 of 11 new or added lines in 4 files covered. (100.0%)

4 existing lines in 2 files now uncovered.

492 of 496 relevant lines covered (99.19%)

4.41 hits per line

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

86.36
/app/views/user/show.rb
1
# frozen_string_literal: true
2

3
module OrcidPrinceton
1✔
4
  module Views
1✔
5
    module User
1✔
6
      # class to display user information
7
      class Show < OrcidPrinceton::View
1✔
8
        expose :user
1✔
9

10
        expose :dom_id do |user|
1✔
11
          "user_#{user.id}"
2✔
12
        end
13

14
        expose :orcid_url do |user|
1✔
15
          "https://orcid.org/#{user.orcid}"
2✔
16
        end
17

18
        expose :user_url do |user|
1✔
19
          Hanami.app.router.url(:user_json, id: user.id)
2✔
20
        end
21

22
        expose :token_prompt do |token_empty, token_expired, user|
1✔
23
          prompt = if token_empty
2✔
24
                     "There is no ORCID iD associated with your NetID, #{user.uid}"
2✔
UNCOV
25
                   elsif token_expired
×
UNCOV
26
                     'Your ORCID token has expired. Please click the button below to ' \
×
27
                       're-authorize Princeton University to access your ORCID record.'
28
                   else
UNCOV
29
                     ''
×
30
                   end
31
          prompt
2✔
32
        end
33

34
        expose :token_expired do |user, orcid_available|
1✔
35
          user.tokens_expired? && orcid_available
2✔
36
        end
37

38
        expose :token_empty do |user|
1✔
39
          user.orcid.nil? || user.orcid.empty? || user.tokens.count.zero?
2✔
40
        end
41

42

43
      end
44
    end
45
  end
46
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