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

pulibrary / pdc_discovery / d4e0f429-48ab-46c0-b837-27bacddd2a41

24 Apr 2024 06:43PM UTC coverage: 92.63% (-4.4%) from 97.039%
d4e0f429-48ab-46c0-b837-27bacddd2a41

Pull #614

circleci

leefaisonr
Remove firefox from ci

Co-authored-by: Bess Sadler <bess@users.noreply.github.com>
Pull Request #614: Remove firefox from ci

2878 of 3107 relevant lines covered (92.63%)

495.74 hits per line

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

47.83
/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 }
19✔
5
  let(:indexer) do
1✔
6
    DspaceIndexer.new(community_fetch_with_expanded_metadata)
18✔
7
  end
8

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

15
  it "has expected header fields" do
1✔
16
    visit '/catalog/78348'
3✔
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.author-name'
×
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'
3✔
26
    expect(page).to have_content "Midplane neutral density profiles in the National Spherical Torus Experiment"
×
27
    find('#show-more-metadata-link').click
×
28
    author1 = '<span class="author-name">Stotler, D.;</span>'
×
29
    author2 = '<span class="author-name">F. Scotti;</span>'
×
30
    community1 = '<a href="/?f[communities_ssim][]=Spherical+Torus&amp;q=&amp;search_field=all_fields">Spherical Torus</a>'
×
31
    community2 = '<a href="/?f[communities_ssim][]=Princeton+Plasma+Physics+Laboratory&amp;q=&amp;search_field=all_fields">Princeton Plasma Physics Laboratory</a>'
×
32
    collection = '<span><a href="/?f[collection_tag_ssim][]=NSTX&amp;q=&amp;search_field=all_fields">NSTX</a></span>'
×
33
    expected_values = [author1, author2, community1, community2, collection]
×
34
    expected_values.each do |value|
×
35
      expect(page.html.include?(value)).to be true
×
36
    end
37
  end
38
  # rubocop:enable RSpec/ExampleLength
39

40
  # rubocop:disable Layout/LineLength
41
  it "has expected citation information" do
1✔
42
    visit '/catalog/78348'
3✔
43
    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."
×
44
    expect(page).to have_content apa_citation
×
45
    expect(page.html.include?('<button id="show-apa-citation-button"')).to be true
×
46
    expect(page.html.include?('<button id="show-bibtex-citation-button"')).to be true
×
47
  end
48
  # rubocop:enable Layout/LineLength
49

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

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

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

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