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

pulibrary / orangelight / 74f665c7-f2bb-4d43-bc3a-ac5c3f09805a

22 Jan 2026 08:23PM UTC coverage: 94.988% (-0.2%) from 95.215%
74f665c7-f2bb-4d43-bc3a-ac5c3f09805a

Pull #5557

circleci

Ryan Laddusaw
Add report missing item form
Pull Request #5557: Add report missing item form

14 of 29 new or added lines in 3 files covered. (48.28%)

1 existing line in 1 file now uncovered.

6160 of 6485 relevant lines covered (94.99%)

1437.61 hits per line

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

95.56
/app/controllers/feedback_controller.rb
1
# frozen_string_literal: true
2

3
class FeedbackController < ApplicationController
3✔
4
  include ApplicationHelper
3✔
5

6
  before_action :current_user_email
3✔
7
  before_action :build_feedback_form, only: [:create]
3✔
8
  before_action :build_ask_a_question_form, only: [:ask_a_question]
3✔
9
  before_action :build_suggest_correction_form, only: [:suggest_correction]
3✔
10
  before_action :build_missing_item_form, only: [:missing_item]
3✔
11

12
  def new
3✔
13
    @feedback_form = FeedbackForm.new if @feedback_form.nil?
5✔
14
    @feedback_form.current_url = request.referer || root_url
5✔
15
  end
16

17
  def create
3✔
18
    respond_to do |format|
4✔
19
      if @feedback_form.valid?
4✔
20
        @feedback_form.deliver
3✔
21
        format.js { flash.now[:notice] = I18n.t('blacklight.feedback.success') }
6✔
22
      else
23
        format.js { flash.now[:error] = @feedback_form.error_message }
2✔
24
      end
25
    end
26
  end
27

28
  def ask_a_question; end
3✔
29

30
  def suggest_correction; end
3✔
31

32
  def missing_item; end
3✔
33

34
  protected
3✔
35

36
    def build_feedback_form
3✔
37
      @feedback_form = FeedbackForm.new(feedback_form_params)
4✔
38
      @feedback_form.request = request
4✔
39
      @feedback_form
4✔
40
    end
41

42
    def feedback_form_params
3✔
43
      params.expect(feedback_form: %i[name email message current_url feedback_desc])
4✔
44
    end
45

46
    def build_ask_a_question_form
3✔
47
      @question_form = AskAQuestionForm.new(
5✔
48
        context: page_url(question_form_params),
49
        title: question_form_params['title']
50
      )
51
    end
52

53
    def question_form_params
3✔
54
      params.expect(ask_a_question_form: %i[id title])
10✔
55
    end
56

57
    def build_suggest_correction_form
3✔
58
      @suggest_correction_form = SuggestCorrectionForm.new(
6✔
59
        context: page_url(suggest_correction_form_params),
60
        title: suggest_correction_form_params['title']
61
      )
62
    end
63

64
    def suggest_correction_form_params
3✔
65
      params.expect(suggest_correction_form: %i[id title])
12✔
66
    end
67

68
    def build_missing_item_form
3✔
NEW
69
      @missing_item_form = MissingItemForm.new(
×
70
        context: page_url(missing_item_form_params),
71
        title: missing_item_form_params['title']
72
      )
73
    end
74

75
    def missing_item_form_params
3✔
NEW
76
      params.expect(missing_item_form: %i[id title])
×
77
    end
78

79
    def page_url(params)
3✔
80
      solr_document_url(id: params['id'])
11✔
81
    end
82

83
    def current_user_email
3✔
84
      return if current_user.nil?
20✔
85
      return if current_user.provider != 'cas'
1✔
86
      @user_email = "#{current_user.uid}@princeton.edu"
1✔
87
      @user_email
1✔
88
    end
89
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