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

pulibrary / pdc_discovery / 5af13607-7741-41ac-b110-c94c8a3ee0f0

pending completion
5af13607-7741-41ac-b110-c94c8a3ee0f0

Pull #441

circleci

hectorcorrea
Better error handling
Pull Request #441: Indexing to a new collection

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

1816 of 2220 relevant lines covered (81.8%)

95.45 hits per line

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

37.21
/spec/system/single_item_metadata_spec.rb
1
# frozen_string_literal: true
2

3
describe 'Single item page', type: :system, js: true do
1✔
4
  let(:community_fetch_with_expanded_metadata) { file_fixture("single_item.xml").read }
7✔
5
  let(:indexer) do
1✔
6
    DspaceIndexer.new(community_fetch_with_expanded_metadata)
6✔
7
  end
8

9
  before do
1✔
10
    Blacklight.default_index.connection.delete_by_query("*:*")
6✔
11
    Blacklight.default_index.connection.commit
6✔
12
    indexer.index
6✔
13
  end
14

15
  it "has expected header fields" do
1✔
16
    visit '/catalog/78348'
×
17
    expect(page).to have_css '.document-title-heading'
×
18
    expect(page).to have_css '.authors-heading'
×
19
    expect(page).to have_css 'div.authors-heading > span > i.bi-person-fill'
×
20
    expect(page).to have_css '.issue-date-heading'
×
21
  end
22

23
  # rubocop:disable RSpec/ExampleLength
24
  it "has expected metadata" do
1✔
25
    visit '/catalog/78348'
×
26
    expect(page).to have_content "Midplane neutral density profiles in the National Spherical Torus Experiment"
×
27

28
    authors = "<span>Stotler, D.; F. Scotti; R.E. Bell; A. Diallo; B.P. LeBlanc; M. Podesta; A.L. Roquemore; P.W. Ross</span>"
×
29
    community = "<span>Princeton Plasma Physics Laboratory|Spherical Torus</span>"
×
30
    collection = "<span>NSTX</span>"
×
31
    expected_values = [authors, community, collection]
×
32
    expected_values.each do |value|
×
33
      expect(page.html.include?(value)).to be true
×
34
    end
35
  end
36
  # rubocop:enable RSpec/ExampleLength
37

38
  # rubocop:disable Layout/LineLength
39
  it "has expected citation information" do
1✔
40
    visit '/catalog/78348'
×
41
    apa_citation = "Stotler, D., F. Scotti, R.E. Bell, A. Diallo, B.P. LeBlanc, M. Podesta, A.L. Roquemore, & P.W. Ross. (2016). Midplane neutral density profiles in the National Spherical Torus Experiment [Data set]. Princeton Plasma Physics Laboratory, Princeton University."
×
42
    expect(page).to have_content apa_citation
×
43
    expect(page.html.include?('<button id="show-apa-citation-button"')).to be true
×
44
    expect(page.html.include?('<button id="show-bibtex-citation-button"')).to be true
×
45
  end
46
  # rubocop:enable Layout/LineLength
47

48
  it "has expected HTML SPAN element with COinS information" do
1✔
49
    visit '/catalog/78348'
×
50
    expect(page.html.include?('<span class="Z3988"')).to be true
×
51
  end
52

53
  it "renders pageviews and downloads stats" do
1✔
54
    visit '/catalog/78348'
×
55
    expect(page.html.include?('<span id="pageviews"')).to be true
×
56
    expect(page.html.include?('<span id="downloads"')).to be true
×
57
  end
58

59
  context "clickable links" do
1✔
60
    let(:globus_download_link) { "https://app.globus.org/file-manager?origin_id=dc43f461-0ca7-4203-848c-33a9fc00a464=%2Fvsj7-4j83%2F" }
1✔
61

62
    it "renders hyperlinks in the abstract and description fields" do
1✔
63
      visit '/catalog/78348'
×
64
      expect(page.html.include?('<a href="http://torus.example.com">http://torus.example.com</a>')).to be true
×
65
      links = page.find("div.document-description").find_all("a").map { |a| a["href"] }
×
66
      expect(links.include?(globus_download_link)).to be true
×
67
    end
68
  end
69
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