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

pulibrary / orangelight / 429ebc30-38c1-4966-adc2-b2091c6abbb4

16 Jul 2025 04:59PM UTC coverage: 95.372% (+0.005%) from 95.367%
429ebc30-38c1-4966-adc2-b2091c6abbb4

push

circleci

web-flow
Refactor holding_location_scsb methods into their own view component (#4993)

Co-authored-by: Christina Chortaria <christinach@users.noreply.github.com>
Co-authored-by: regineheberlein <regineheberlein@users.noreply.github.com>
Co-authored-by: Ryan Jensen <RyanAJensen@users.noreply.github.com>

20 of 21 new or added lines in 2 files covered. (95.24%)

6038 of 6331 relevant lines covered (95.37%)

1515.06 hits per line

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

93.33
/app/components/holdings/holding_availability_scsb_component.rb
1
# frozen_string_literal: true
2

3
# This component is responsible for rendering a SCSB holding's availability
4
# (which will be provided by Javascript based on the DOM structure of
5
# this component)
6
class Holdings::HoldingAvailabilityScsbComponent < ViewComponent::Base
3✔
7
  def initialize(holding, doc_id, holding_id)
3✔
8
    @holding = holding
18✔
9
    @doc_id = doc_id
18✔
10
    @holding_id = holding_id
18✔
11
  end
12

13
    private
3✔
14

15
      attr_reader :holding, :doc_id, :holding_id
3✔
16

17
      def scsb_supervised_items?
3✔
18
        if holding.key? 'items'
25✔
19
          restricted_items = items.select do |item|
25✔
20
            item['use_statement'] == 'Supervised Use'
134✔
21
          end
22
          restricted_items.count == items.count
25✔
23
        else
NEW
24
          false
×
25
        end
26
      end
27

28
      def items
3✔
29
        @items ||= holding['items']
50✔
30
      end
31
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