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

pulibrary / tigerdata-app / d7ce1bf9-25b8-4b3e-b9dd-43f9a26f2d96

17 Oct 2025 05:51PM UTC coverage: 91.054%. Remained the same
d7ce1bf9-25b8-4b3e-b9dd-43f9a26f2d96

Pull #2055

circleci

jrgriffiniii
- Ensuring that `parallelism` is set to 4
- Separating `system` RSpec spec suites in the CI build
- Using an `inconsistent` RSpec tag to mark inconsistently failing tests
- Ensuring that CI does not run for `inconsistent` tests
Pull Request #2055: Ensuring that `parallelism` is set to 4 for CircleCI and separates `system` and inconsistently-failing tests into separate CI jobs

2738 of 3007 relevant lines covered (91.05%)

380.37 hits per line

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

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

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

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

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

20
  def update
1✔
21
    update_user_with_params
1✔
22
    redirect_to user_path(@user)
1✔
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])
×
29
  end
30

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

40
  private
1✔
41

42
    def set_breadcrumbs
1✔
43
      add_breadcrumb("Users", users_path)
23✔
44
    end
45

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

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

© 2025 Coveralls, Inc