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

pulibrary / orangelight / 19c031bc-ec64-467e-8f6a-66cdadc43077

30 Oct 2025 06:51PM UTC coverage: 95.407% (-0.02%) from 95.426%
19c031bc-ec64-467e-8f6a-66cdadc43077

Pull #5281

circleci

christinach
Address review comments by Jane
Remove request_respones hanlder integration spec
Move event initialize into the constructor. It was only one.
Removed stale method from the form controller
Remove button x from the flas_messages partial
Remove global access on the request handler for debugging purposes in the request.js entrypoint

Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>

related to [#5264]
Pull Request #5281: Don't use Rails ujs for request form submission

32 of 32 new or added lines in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

6190 of 6488 relevant lines covered (95.41%)

1468.86 hits per line

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

60.53
/app/helpers/requests/request_helper.rb
1
# frozen_string_literal: true
2
module Requests
3✔
3
  module RequestHelper
3✔
4
    def parse_json(data)
3✔
5
      JSON.parse(data).with_indifferent_access
×
6
    end
7

8
    def current_user_status(current_user)
3✔
9
      ## Expect that the host app can provide you a devise current_user object
10
      if current_user.cas_provider?
×
11
        content_tag(:div, class: "flash_messages-user") do
×
12
          content_tag(:div, I18n.t('requests.account.pul_auth', current_user_name: current_user.uid), class: "flash-alert")
×
13
        end
14
      elsif current_user.guest?
×
15
        content_tag(:div) do
×
16
          concat link_to I18n.t('blacklight.login.netid_login_msg'), '/users/auth/cas', role: 'menuitem', class: 'btn btn-primary', id: 'cas-login' # , current_user_name: current_user.uid)
×
17
        end
18
      else
19
        I18n.t('requests.account.unauthenticated')
×
20
      end
21
    end
22

23
    def pul_patron_name(patron)
3✔
24
      return "" if patron.last_name.blank? && patron.first_name.blank?
77✔
25
      "#{patron.first_name} #{patron.last_name}"
69✔
26
    end
27

28
    def request_title
3✔
29
      I18n.t('requests.default.form_title')
84✔
30
    end
31

32
    def return_message(submission)
3✔
UNCOV
33
      link_to "Return to Record", return_url(submission.id), class: 'btn btn-secondary icon-moveback', title: 'Return to Record'
×
34
    end
35

36
    def login_url(request)
3✔
37
      url = "/requests/#{request.bib_id}?"
×
38
      params = []
×
39
      params.push("mfhd=#{request.mfhd}") unless request.mfhd.nil?
×
40
      url += params.join("&")
×
41

42
      url
×
43
    end
44

45
    def return_url(id)
3✔
UNCOV
46
      "/catalog/#{id}"
×
47
    end
48

49
    def zero_results_link(query_params, search_field)
3✔
50
      if query_params
16✔
51
        "https://princeton-borrowdirect.reshare.indexdata.com/Search/Results?lookfor=#{query_params}&type=#{reshare_type(search_field)}"
13✔
52
      else
53
        "https://princeton-borrowdirect.reshare.indexdata.com/Search/Results"
3✔
54
      end
55
    end
56

57
    def reshare_type(search_field)
3✔
58
      case search_field
13✔
59
      when 'all_fields'
60
        'AllFields'
4✔
61
      when 'author'
62
        'Author'
1✔
63
      when 'subject'
64
        'Subject'
1✔
65
      when 'title'
66
        'Title'
2✔
67
      else
68
        'AllFields'
5✔
69
      end
70
    end
71
  end
72
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