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

MarkUsProject / Markus / 16590227485

29 Jul 2025 08:00AM UTC coverage: 91.883% (+0.001%) from 91.882%
16590227485

Pull #7602

github

web-flow
Merge 581c293ba into 8944608a8
Pull Request #7602: Added loading icon for instructor table

662 of 1423 branches covered (46.52%)

Branch coverage included in aggregate %.

2 of 16 new or added lines in 2 files covered. (12.5%)

26 existing lines in 3 files now uncovered.

42038 of 45049 relevant lines covered (93.32%)

118.7 hits per line

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

96.67
/app/controllers/instructors_controller.rb
1
# Controller for managing Instructor roles
2
class InstructorsController < ApplicationController
1✔
3
  before_action { authorize! }
22✔
4

5
  layout 'assignment_content'
1✔
6

7
  responders :flash, :collection
1✔
8

9
  def index
1✔
10
    # sleep 5
11
    respond_to do |format|
3✔
12
      format.html
3✔
13
      format.json do
3✔
14
        instructors = current_course.instructors
2✔
15
                                    .joins(:user)
16
                                    .where(type: Instructor.name)
17
        render json: {
2✔
18
          data: instructors.pluck_to_hash(:id, :user_name, :first_name, :last_name, :email, :hidden),
19
          counts: {
20
            all: instructors.size,
21
            active: instructors.active.size,
22
            inactive: instructors.inactive.size
23
          }
24
        }
25
      end
26
    end
27
  end
28

29
  def new
1✔
30
    @role = current_course.instructors.new
1✔
31
  end
32

33
  def create
1✔
34
    @role = current_course.instructors.create(create_update_params)
7✔
35
    respond_with @role, location: course_instructors_path(current_course)
7✔
36
  end
37

38
  def edit
1✔
UNCOV
39
    @role = record
×
40
  end
41

42
  def update
1✔
43
    @role = record
6✔
44
    @role.update(create_update_params)
6✔
45
    respond_with @role, location: course_instructors_path(current_course)
6✔
46
  end
47

48
  private
1✔
49

50
  def create_update_params
1✔
51
    user = EndUser.find_by(user_name: end_user_params[:user_name])
13✔
52
    active_status = allowed_to?(:manage_role_status?) ? params.require(:role).permit(:hidden) : {}
13✔
53
    { user: user, **active_status }
13✔
54
  end
55

56
  def end_user_params
1✔
57
    params.require(:role).require(:end_user).permit(:user_name)
13✔
58
  end
59

60
  def flash_interpolation_options
1✔
61
    { resource_name: @role.user&.user_name.blank? ? @role.model_name.human : @role.user_name,
13✔
62
      errors: @role.errors.full_messages.join('; ') }
63
  end
64
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