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

pulibrary / pdc_discovery / 5e867592-a902-4c05-97f1-a03662fb2c14

pending completion
5e867592-a902-4c05-97f1-a03662fb2c14

Pull #441

circleci

hectorcorrea
Rubocop nit picking
Pull Request #441: Indexing to a new collection

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

1791 of 2219 relevant lines covered (80.71%)

8.27 hits per line

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

75.0
/spec/system/dspace_indexing_spec.rb
1
# frozen_string_literal: true
2

3
describe 'DataSpace research data indexing', type: :system do
1✔
4
  subject(:result) do
1✔
5
    indexer.map_record(record)
4✔
6
  end
7
  let(:indexer) do
1✔
8
    Traject::Indexer::NokogiriIndexer.new.tap do |i|
4✔
9
      i.load_config_file(Rails.root.join('lib', 'traject', 'dataspace_research_data_config.rb'))
4✔
10
    end
11
  end
12
  let(:dspace_xml) do
1✔
13
    File.join(fixture_path, 'astrophysical_sciences.xml')
×
14
  end
15
  let(:nokogiri_reader) do
1✔
16
    Traject::NokogiriReader.new(File.read(dspace_xml), indexer.settings)
×
17
  end
18
  let(:records) do
1✔
19
    nokogiri_reader.to_a
×
20
  end
21
  let(:record) do
1✔
22
    records.first
×
23
  end
24

25
  it 'id' do
1✔
26
    expect(result['id'].first).to eq '1301'
1✔
27
  end
28

29
  it 'title' do
1✔
30
    expect(result['title_tesim'].first).to eq 'Seeing the Lyman-Alpha Forest for the Trees: Constraints on the Thermal State of the IGM from SDSS-III/BOSS'
1✔
31
  end
32

33
  it 'referenced_by' do
1✔
34
    expect(result['referenced_by_ssim'].first).to eq 'https://arxiv.org/abs/1903.06605'
1✔
35
  end
36

37
  it 'files' do
1✔
38
    # The fixture has three files but we expect two of them to be ignored
39
    files = JSON.parse(result['files_ss'].first)
1✔
40
    expect(files.count).to eq 1
×
41
    expect(files.first["name"]).to eq 'Lee_princeton_0181D_10086.pdf'
×
42
  end
43
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