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

pulibrary / pdc_discovery / cedc3b2d-44e9-4b13-b019-2823d640a978

pending completion
cedc3b2d-44e9-4b13-b019-2823d640a978

Pull #473

circleci

hectorcorrea
Split line to work around Rubocop false warning
Pull Request #473: ORCID and Affiliation search from popover

7 of 7 new or added lines in 2 files covered. (100.0%)

2261 of 2344 relevant lines covered (96.46%)

188.57 hits per line

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

74.14
/spec/system/bitklavier_single_item_metadata_spec.rb
1
# frozen_string_literal: true
2

3
describe 'PDC Describe Bitklavier Single item page', type: :system, js: true do
1✔
4
  let(:rss_feed) { file_fixture("works.rss").read }
4✔
5
  let(:resource1) { file_fixture("sowing_the_seeds.json").read }
4✔
6
  let(:bitklavier_binaural_json) { file_fixture("bitklavier_binaural.json").read }
4✔
7
  let(:rss_url_string) { "https://pdc-describe-prod.princeton.edu/describe/works.rss" }
4✔
8
  let(:indexer) { DescribeIndexer.new(rss_url: rss_url_string) }
4✔
9

10
  before do
1✔
11
    Blacklight.default_index.connection.delete_by_query("*:*")
3✔
12
    Blacklight.default_index.connection.commit
3✔
13
    stub_request(:get, "https://pdc-describe-prod.princeton.edu/describe/works.rss")
3✔
14
      .to_return(status: 200, body: rss_feed, headers: {})
15
    stub_request(:get, "https://pdc-describe-prod.princeton.edu/describe/works/6.json")
3✔
16
      .to_return(status: 200, body: resource1, headers: {})
17
    stub_request(:get, "https://pdc-describe-prod.princeton.edu/describe/works/20.json")
3✔
18
      .to_return(status: 200, body: bitklavier_binaural_json, headers: {})
19
    indexer.index
3✔
20
  end
21

22
  it "has expected header fields" do
1✔
23
    visit '/catalog/doi-10-34770-r75s-9j74'
1✔
24
    expect(page).to have_css '.document-title-heading'
1✔
25
    expect(page).to have_css '.authors-heading'
1✔
26
    expect(page).to have_css 'div.authors-heading > span.author-name'
1✔
27
    expect(page).to have_css '.issue-date-heading'
1✔
28
  end
29

30
  it "has expected metadata" do
1✔
31
    visit '/catalog/doi-10-34770-r75s-9j74'
1✔
32
    expect(page).to have_content "bitKlavier Grand Sample Library—Binaural Mic Image"
1✔
33
    author_top_of_page = '<span class="author-name">'
1✔
34
    author_popover_title = 'data-original-title="Trueman, Daniel"'
1✔
35
    author_popover_orcid = 'https://orcid.org/1234-1234-1234-1234'
1✔
36
    author_popover_affiliation = "target=_blank>1234-1234-1234-1234</a><br/>\nPrinceton Plasma Physics Laboratory<br/>"
1✔
37
    author_meta = 'Trueman, Daniel (Princeton Plasma Physics Laboratory)'
1✔
38
    expect(page.html.include?(author_top_of_page)).to be true
1✔
39
    expect(page.html.include?(author_popover_title)).to be true
1✔
40
    expect(page.html.include?(author_popover_orcid)).to be true
1✔
41
    expect(page.html.include?(author_popover_affiliation)).to be true
1✔
42
    expect(page.html.include?(author_meta)).to be true
×
43
  end
44

45
  it "renders collection tags as links" do
1✔
46
    visit '/catalog/doi-10-34770-r75s-9j74'
1✔
47
    tag1 = "<a href=\"/?f[collection_tag_ssim][]=Humanities"
1✔
48
    tag2 = "<a href=\"/?f[collection_tag_ssim][]=Something+else"
1✔
49
    expect(page.html.include?(tag1)).to be true
1✔
50
    expect(page.html.include?(tag2)).to be true
1✔
51
  end
52

53
  # rubocop:disable Layout/LineLength
54
  xit "has expected citation information" do
1✔
55
    visit '/catalog/78348'
×
56
    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."
×
57
    expect(page).to have_content apa_citation
×
58
    expect(page.html.include?('<button id="show-apa-citation-button"')).to be true
×
59
    expect(page.html.include?('<button id="show-bibtex-citation-button"')).to be true
×
60
  end
61
  # rubocop:enable Layout/LineLength
62

63
  xit "has expected HTML SPAN element with COinS information" do
1✔
64
    visit '/catalog/78348'
×
65
    expect(page.html.include?('<span class="Z3988"')).to be true
×
66
  end
67

68
  xit "renders pageviews and downloads stats" do
1✔
69
    visit '/catalog/78348'
×
70
    expect(page.html.include?('<span id="pageviews"')).to be true
×
71
    expect(page.html.include?('<span id="downloads"')).to be true
×
72
  end
73

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

77
    xit "renders hyperlinks in the abstract and description fields" do
1✔
78
      visit '/catalog/78348'
×
79
      expect(page.html.include?('<a href="http://torus.example.com">http://torus.example.com</a>')).to be true
×
80
      links = page.find("div.document-description").find_all("a").map { |a| a["href"] }
×
81
      expect(links.include?(globus_download_link)).to be true
×
82
    end
83
  end
84
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