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

pulibrary / allsearch_api / 0400cc50-b3f0-4794-8616-b4382e0acdd0

14 Oct 2025 03:57AM UTC coverage: 94.558% (-5.0%) from 99.514%
0400cc50-b3f0-4794-8616-b4382e0acdd0

Pull #395

circleci

sandbergja
Migrate Library Staff Controller away from ActionController
Pull Request #395: Migrate a few more controllers away from Rails

8 of 8 new or added lines in 4 files covered. (100.0%)

93 existing lines in 21 files now uncovered.

973 of 1029 relevant lines covered (94.56%)

71.0 hits per line

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

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

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

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

14
  private
2✔
15

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

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

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