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

uclibs / treatment_database / 18559ad8-9240-4d18-b0f3-c3e99907385b

14 Oct 2024 06:23PM UTC coverage: 98.841% (+21.3%) from 77.543%
18559ad8-9240-4d18-b0f3-c3e99907385b

push

circleci

Thomas Scherz
Merge branch 'qa'

101 of 103 branches covered (98.06%)

Branch coverage included in aggregate %.

17 of 23 new or added lines in 5 files covered. (73.91%)

100 existing lines in 14 files now uncovered.

496 of 501 relevant lines covered (99.0%)

42.83 hits per line

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

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

3
class UsersController < ApplicationController
4✔
4
  load_and_authorize_resource
4✔
5

6
  def index
4✔
7
    @users = User.all
7✔
8
  end
9

10
  def new
4✔
UNCOV
11
    @user = User.new
1✔
12
  end
13

14
  def edit
4✔
15
    @user = User.find(params[:id])
3✔
16
  end
17

18
  def create_user
4✔
UNCOV
19
    @user = User.new(user_params)
3✔
20

UNCOV
21
    if @user.save
3✔
UNCOV
22
      flash[:notice] = 'Successfully created User.'
2✔
NEW
23
      redirect_to users_path
2✔
24
    else
NEW
25
      flash.now[:notice] = @user.errors.full_messages.first
1✔
UNCOV
26
      redirect_back fallback_location: root_path
1✔
27
    end
28
  end
29

30
  def update
4✔
31
    @user = User.find(params[:id])
7✔
32

33
    if @user.update(user_params)
7✔
34
      flash[:notice] = 'User was successfully updated.'
6✔
35
      redirect_to users_path
6✔
36
    else
NEW
37
      flash.now[:alert] = @user.errors.full_messages.first
1✔
NEW
38
      render :edit
1✔
39
    end
40
  end
41

42
  private
4✔
43

44
  def user_params
4✔
45
    params.require(:user).permit(:id, :display_name, :email, :role, :account_active, :password, :password_confirmation)
10✔
46
  end
47
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