• 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

41.67
/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 }
10✔
5
  let(:resource1) { file_fixture("sowing_the_seeds.json").read }
10✔
6
  let(:bitklavier_binaural_json) { file_fixture("bitklavier_binaural.json").read }
10✔
7
  let(:rss_url_string) { "https://pdc-describe-prod.princeton.edu/describe/works.rss" }
10✔
8
  let(:indexer) { DescribeIndexer.new(rss_url: rss_url_string) }
10✔
9

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

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

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

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

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

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

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

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

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