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

pulibrary / oawaiver / 40ca2f09-e694-44a5-b909-7cce179b9e67

11 Jul 2024 05:42PM UTC coverage: 0.0% (-80.4%) from 80.383%
40ca2f09-e694-44a5-b909-7cce179b9e67

push

circleci

jrgriffiniii
Trying to expand the RSpec test suite for EmployeesController#ajax_search

0 of 1206 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/app/helpers/application_helper.rb
1
# frozen_string_literal: true
2

3
module ApplicationHelper
×
4
  def top_layout_css_class(params)
×
5
    "#{params['controller']} #{params['controller']}_#{params['action']} rails_#{Rails.env}"
×
6
  end
×
7

8
  def google_scholar_link(string)
×
9
    # articles
10
    link_to("http://scholar.google.com/scholar?as_sdt=0,31&q=" + string.split.join("+"),
×
11
            class: "admin_actions") do
×
12
      image_tag("googlescholar.ico", width: "16px")
×
13
    end
×
14
  end
×
15

16
  def waiver_infos_property_or_link(prop, val, link_label = nil)
×
17
    link_label ||= val
×
18
    return waiver_infos_select_by({ prop => val }, link_label) if current_account_admin?
×
19

20
    link_label
×
21
  end
×
22

23
  def waiver_infos_select_by(hsh, link_text = "W")
×
24
    link_args = search_waiver_infos_path(
×
25
      params: {
×
26
        waiver_info: hsh
×
27
      }
×
28
    )
×
29

30
    link_to(link_args, class: "admin_actions") do
×
31
      link_text
×
32
    end
×
33
  end
×
34

35
  def sherpa_romeo_journal(string, label = "SR")
×
36
    link_to("http://www.sherpa.ac.uk/romeo/search.php?versions=all&prule=ALL&jrule=CONTAINS&search=" + string.split.join("+"),
×
37
            class: "admin_actions") do
×
38
      label
×
39
    end
×
40
  end
×
41

42
  def directory_link(email, label = "?-DIR")
×
43
    link_to("http://search.princeton.edu/search?e=" + Rack::Utils.escape(email),
×
44
            class: "admin_actions") do
×
45
      label
×
46
    end
×
47
  end
×
48

49
  def institution_site_search(words, label = "?-PU")
×
50
    link_to("http://www.princeton.edu/main/tools/search/?q=" + Rack::Utils.escape(words.split.join("+")),
×
51
            class: "admin_actions") do
×
52
      label
×
53
    end
×
54
  end
×
55

56
  def employee_list(name, label = "A")
×
57
    link_to(search_get_employees_path(search_term: name), class: "admin_actions") do
×
58
      label
×
59
    end
×
60
  end
×
61

62
  def sign_out_form(html_opts = {})
×
63
    html_opts[:class] = html_opts.fetch(:class, []) + ["form"]
×
64

65
    form_with url: destroy_account_session_path, method: :delete, **html_opts do |form|
×
66
      form.submit("Logout", class: ["btn"])
×
67
    end
×
68
  end
×
69

70
  def sign_out_link(html_opts = {})
×
71
    child_element = tag.span("", class: "glyphicon glyphicon-user")
×
72

73
    children = child_element + sign_out_form(html_opts)
×
74
    tag.div(children, class: ["navigation-auth"])
×
75
  end
×
76

77
  def sign_in_link(html_opts = {})
×
78
    child_element = tag.span("", class: "glyphicon glyphicon-user")
×
79
    link_to(child_element + " Login", account_cas_omniauth_authorize_path, html_opts)
×
80
  end
×
81

82
  def devise_session_link(html_opts = {})
×
83
    return sign_out_link(html_opts) if current_account
×
84

85
    sign_in_link(html_opts)
×
86
  end
×
87

88
  def paginate_length(objects)
×
89
    return objects.total_entries if objects.respond_to? :total_entries
×
90
    return objects.total_count if objects.respond_to? :total_count
×
91
    return objects.length if objects.respond_to? :length
×
92

93
    "unknown"
×
94
  end
×
95

96
  def current_roles
×
97
    return [] unless current_account
×
98

99
    @roles ||= Account.roles(current_account)
×
100
  end
×
101

102
  def body_class_names
×
103
    output = current_roles.join(" ")
×
104
    output.downcase
×
105
  end
×
106

107
  def current_account_admin?
×
108
    current_roles.include?("ADMIN")
×
109
  end
×
110
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