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

pulibrary / allsearch_api / 322d09b9-bf13-4991-90db-61f466d8fd7d

02 Dec 2025 06:07PM UTC coverage: 99.905% (+12.0%) from 87.896%
322d09b9-bf13-4991-90db-61f466d8fd7d

push

circleci

web-flow
Merge pull request #416 from pulibrary/repo-factory

Extract ROM repository creation into a factory

17 of 17 new or added lines in 3 files covered. (100.0%)

78 existing lines in 18 files now uncovered.

1055 of 1056 relevant lines covered (99.91%)

102.95 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