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

pulibrary / tigerdata-app / 7e114010-4302-48ab-8569-6ef727f09d6c

10 Nov 2025 04:43PM UTC coverage: 87.611% (-3.8%) from 91.371%
7e114010-4302-48ab-8569-6ef727f09d6c

Pull #2175

circleci

bess
Merge branch 'i2166-string-reverse' of github.com:pulibrary/tigerdata-app into i2166-string-reverse
Pull Request #2175: Show the status of our java plugin

5 of 7 new or added lines in 1 file covered. (71.43%)

118 existing lines in 14 files now uncovered.

2758 of 3148 relevant lines covered (87.61%)

347.82 hits per line

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

0.0
/app/controllers/users_controller.rb
1
# frozen_string_literal: true
UNCOV
2
class UsersController < ApplicationController
×
UNCOV
3
  before_action :set_breadcrumbs
×
UNCOV
4
  before_action :check_user_access, only: %i[index show edit update]
×
5

UNCOV
6
  def index
×
UNCOV
7
    @users = User.order("uid ASC NULLS LAST").page params[:page]
×
UNCOV
8
  end
×
9

UNCOV
10
  def show
×
UNCOV
11
    add_breadcrumb("User")
×
UNCOV
12
    @user = User.find(params[:id])
×
UNCOV
13
  end
×
14

UNCOV
15
  def edit
×
UNCOV
16
    add_breadcrumb("Edit User")
×
UNCOV
17
    @user = User.find(params[:id])
×
UNCOV
18
  end
×
19

UNCOV
20
  def update
×
UNCOV
21
    update_user_with_params
×
UNCOV
22
    redirect_to user_path(@user)
×
UNCOV
23
  rescue => ex
×
24
    short_message = "Error saving user #{params[:id]}"
×
25
    Rails.logger.error "#{short_message}: #{ex.message}"
×
26
    Honeybadger.notify "#{short_message}: #{ex.message}"
×
27
    flash[:alert] = short_message
×
28
    redirect_to user_path(id: params[:id])
×
UNCOV
29
  end
×
30

UNCOV
31
  def lookup
×
UNCOV
32
    query = (params["query"] || "").strip.downcase
×
UNCOV
33
    matches = PrincetonUsers.user_list_query(query)
×
UNCOV
34
    result = {
×
UNCOV
35
      suggestions: matches.take(30).map { |match| { "value": match[:display_name] || "", "data": match[:uid] } }
×
UNCOV
36
    }
×
UNCOV
37
    render json: result
×
UNCOV
38
  end
×
39

UNCOV
40
  private
×
41

UNCOV
42
    def set_breadcrumbs
×
UNCOV
43
      add_breadcrumb("Users", users_path)
×
UNCOV
44
    end
×
45

UNCOV
46
    def check_user_access
×
UNCOV
47
      return if current_user.developer || current_user.sysadmin || current_user.trainer
×
UNCOV
48
      flash[:notice] = "You do not have access to this page (#{current_user.uid})"
×
UNCOV
49
      redirect_to dashboard_path
×
UNCOV
50
    end
×
51

52
    # rubocop:disable Metrics/AbcSize
UNCOV
53
    def update_user_with_params
×
UNCOV
54
      @user = User.find(params[:id])
×
UNCOV
55
      @user.given_name = params["user"]["given_name"]
×
UNCOV
56
      @user.family_name = params["user"]["family_name"]
×
UNCOV
57
      @user.display_name = params["user"]["display_name"]
×
UNCOV
58
      @user.eligible_sponsor = params["user"]["eligible_sponsor"] == "1"
×
UNCOV
59
      @user.eligible_manager = params["user"]["eligible_manager"] == "1"
×
UNCOV
60
      @user.developer = params["user"]["developer"] == "1"
×
UNCOV
61
      @user.sysadmin = params["user"]["sysadmin"] == "1"
×
UNCOV
62
      @user.trainer = params["user"]["trainer"] == "1"
×
UNCOV
63
      @user.save!
×
UNCOV
64
    end
×
65
  # rubocop:enable Metrics/AbcSize
UNCOV
66
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

© 2026 Coveralls, Inc