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

pulibrary / allsearch_api / 29cc47ba-38a5-447a-9a89-fa55bc36f401

14 Oct 2025 01:59PM UTC coverage: 99.32% (-0.2%) from 99.514%
29cc47ba-38a5-447a-9a89-fa55bc36f401

Pull #395

circleci

sandbergja
add missing require_relative
Pull Request #395: Migrate a few more controllers away from Rails

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

90 existing lines in 18 files now uncovered.

1022 of 1029 relevant lines covered (99.32%)

96.72 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