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

pulibrary / allsearch_api / 9eae8e03-b4ba-4fef-a63b-d5780d976746

30 Jun 2025 12:00PM UTC coverage: 99.492% (+0.001%) from 99.491%
9eae8e03-b4ba-4fef-a63b-d5780d976746

Pull #379

circleci

maxkadel
Ensure we sort library staff correctly, and include bios in searchable field

Closes #371

Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>
Co-authored-by: Kevin Reiss <kevinreiss@users.noreply.github.com>
Co-authored-by: Ryan Laddusaw <rladdusaw@users.noreply.github.com>
Pull Request #379: Ensure we sort library staff correctly, and include bios in searchabl…

3 of 3 new or added lines in 1 file covered. (100.0%)

95 existing lines in 17 files now uncovered.

979 of 984 relevant lines covered (99.49%)

101.71 hits per line

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

100.0
/app/services/sample_data_creation_service.rb
1
# frozen_string_literal: true
2

3
class SampleDataCreationService
3✔
4
  def initialize(solr_collection:, filename:, query: 'cats')
3✔
UNCOV
5
    @solr_collection = solr_collection
1✔
UNCOV
6
    @query = query
1✔
UNCOV
7
    @file_path = Rails.root.join('sample-data', filename)
1✔
8
  end
9

10
  def create
3✔
UNCOV
11
    file_path.write(docs.to_json)
1✔
12
  end
13

14
  private
3✔
15

16
  attr_reader :file_path, :query, :solr_collection
3✔
17

18
  def docs
3✔
UNCOV
19
    @docs ||= begin
1✔
UNCOV
20
      response = Net::HTTP.get(uri)
1✔
UNCOV
21
      parsed = JSON.parse(response, symbolize_names: true)[:response][:docs]
1✔
UNCOV
22
      parsed.map do |document|
1✔
UNCOV
23
        document.except(:hashed_id_ssi, :solr_bboxtype, :timestamp, :_version_)
3✔
24
      end
25
    end
26
  end
27

28
  def uri
3✔
UNCOV
29
    URI.parse "http://localhost:7872/solr/#{solr_collection}/select?q=#{query}&rows=5&facet=false&fl=*"
1✔
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