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

uclibs / treatment_database / bd85621f-f5ea-4349-b2df-8f1cf2344fa0

11 Mar 2025 01:30PM UTC coverage: 92.272%. First build
bd85621f-f5ea-4349-b2df-8f1cf2344fa0

push

circleci

web-flow
FEATURE BRANCH - 407 Add SSO (#498)

* Add SSO with Shibboleth

* LIBTREATDB-56 Replace Devise with Custom Session Management - FEATURE BRANCH (#532)

* Copy ucrate tests - first pass

* Add necessary gems

* reviewed test list

* files reviewed 51724

* reviewed tests and deleted or modified

* Test update 5/20

* LIBTREATDB-38 add sso configuration to environment variables (#528)

* LIBTREATDB-61 - Remove env variables (#529)

* Remove Shibboleth environment variables, comment out Shibboleth tests

* LIBTREATDB-61 link issue to Jira

* Copy ucrate tests - first pass

reviewed test list

LIBTREATDB-55 set up to use shibboleth with middleware (#530)

* Remove Shibboleth environment variables, comment out Shibboleth tests

* LIBTREATDB-61 link issue to Jira

* LIBTREATDB-55 Set up middleware to use Shibboleth

* LIBTREATDB-55 Rubocop fix

* WIP

* Revert "WIP"

This reverts commit <a class=hub.com/uclibs/treatment_database/commit/9a3987c91ea32d7e0410fd9bb3a34905fcfc8431">9a3987c91.

* Re-run bundle install

* Upgrade to pagy 9

* Add test for callbacks controller

* Rubocop fix for new callbacks controller spec

LIBTREATDB-55 set up to use shibboleth with middleware (#530)

* Remove Shibboleth environment variables, comment out Shibboleth tests

* LIBTREATDB-61 link issue to Jira

* LIBTREATDB-55 Set up middleware to use Shibboleth

* LIBTREATDB-55 Rubocop fix

* WIP

* Revert "WIP"

This reverts commit 9a3987c91ea32d7e0410fd9bb3a34905fcfc8431.

* Re-run bundle install

* Upgrade to pagy 9

* Add test for callbacks controller

* Rubocop fix for new callbacks controller spec

Migrate to remove Devise user fields, Add bcrypt to gemfile

WIP

WIP - need to check tests

Fix accidental changes, clean-up

WIP

WIP - 106 failing tests

View and Controller tests working, WIP

WIP, in-progress for request tests

WIP - request tests fail when run in entire suite

Rubocop changes

WIP

WIP

Fix tests

Fix brakeman error for possible mass assignment

WIP

Correct add-username migration to allow for previous user data

WIP

... (continued)

204 of 219 new or added lines in 16 files covered. (93.15%)

597 of 647 relevant lines covered (92.27%)

36.38 hits per line

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

84.38
/app/controllers/admin/users_controller.rb
1
# frozen_string_literal: true
2

3
module Admin
3✔
4
  class UsersController < ApplicationController
3✔
5
    before_action :authorize_admin
3✔
6
    before_action :set_user, only: %i[show edit update destroy]
3✔
7

8
    def index
3✔
9
      @users = User.all
4✔
10
    end
11

12
    def show; end
3✔
13

14
    def new
3✔
15
      @user = User.new
1✔
16
    end
17

18
    def edit; end
3✔
19

20
    def create
3✔
21
      @user = User.new(user_params)
1✔
22

23
      if @user.save
1✔
24
        redirect_to admin_users_path, notice: 'User created successfully.'
1✔
25
      else
NEW
26
        flash.now[:alert] = 'There was a problem creating the user. Please check the errors below.'
×
NEW
27
        render :new
×
28
      end
29
    end
30

31
    def update
3✔
32
      if @user.update(user_params)
3✔
33
        redirect_to admin_users_path, notice: 'Profile updated successfully.'
3✔
34
      else
NEW
35
        flash.now[:alert] = 'There was a problem editing the user. Please check the errors below.'
×
NEW
36
        render :edit
×
37
      end
38
    end
39

40
    def destroy
3✔
NEW
41
      redirect_to admin_users_path, alert: 'User deletion is not permitted.'
×
42
    end
43

44
    private
3✔
45

46
    def set_user
3✔
47
      @user = User.find(params[:id])
4✔
48
    end
49

50
    def authorize_admin
3✔
51
      redirect_to root_path, alert: 'Access denied.' unless admin?
10✔
52
    end
53

54
    def user_params
3✔
55
      permitted_attributes = %i[username display_name]
4✔
56
      permitted_attributes += %i[role account_active] if admin?
4✔
57
      params.require(:user).permit(permitted_attributes)
4✔
58
    end
59
  end
60
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