• 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/controllers/application_controller.rb
1
# frozen_string_literal: true
2

3
class ApplicationController < ActionController::Base
×
4
  before_action :authenticate_account!, only: [:manage]
×
5

6
  # Prevent CSRF attacks by raising an exception.
7
  # For APIs, you may want to use :null_session instead.
8
  protect_from_forgery with: :exception
×
9

10
  def logout
×
11
    redirect_to(destroy_account_session_path)
×
12
  end
×
13

14
  def manage
×
15
    @notes = params["notes"] || ""
×
16
    @accounts = Account.where(netid: current_account.netid)
×
17
    @account = Account.new
×
18

19
    render controller: "application", action: "manage"
×
20
  end
×
21

22
  def author_search_status
×
23
    current_author_status_url = AuthorStatus.status_url(context: self)
×
24
    redirect_to(current_author_status_url)
×
25
  end
×
26

27
  private
×
28

29
  def verify_roles
×
30
    logger.debug("#{self.class}: @user=#{current_account} @roles=#{roles.inspect}")
×
31

32
    @is_admin = admin_user?
×
33
  end
×
34
  alias set_roles verify_roles
×
35

36
  # Is this needed?
37
  def current_account_email
×
38
    return unless current_account
×
39

40
    "#{current_account}@princeton.edu"
×
41
  end
×
42

43
  unless Rails.env.development?
×
44
    rescue_from "Exception" do |exception|
×
45
      if exception.is_a?(ActiveRecord::RecordNotFound)
×
46
        render controller: :application, action: :start
×
47
      else
×
48
        flash[:alert] = "An exception occurred: #{exception.message}"
×
49
        render controller: :application, action: :error
×
50
      end
×
51
    end
×
52
  end
×
53

54
  def admin_user?
×
55
    @is_admin ||= roles.include?("ADMIN")
×
56
  end
×
57

58
  def user
×
59
    super || current_account
×
60
  end
×
61

62
  def ensure_admin_role
×
63
    logger.debug("ensure_admin_role for #{current_account} with #{roles}")
×
64

65
    return if current_user&.admin?
×
66

67
    render nothing: true, status: :forbidden
×
68
  end
×
69

70
  def roles
×
71
    return [] unless current_account
×
72

73
    @roles ||= current_account.roles
×
74
  end
×
75

76
  def current_cas_user
×
77
    session[:cas_user]
×
78
  end
×
79

80
  def after_sign_in_path_for(_resource)
×
81
    request.env["omniauth.origin"] || new_account_session_path
×
82
  end
×
83
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