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

pulibrary / pdc_discovery / 1eedbc4b-a89e-4e81-990b-d6c1d10c7ef0

17 Aug 2023 02:13PM UTC coverage: 92.352% (-4.2%) from 96.544%
1eedbc4b-a89e-4e81-990b-d6c1d10c7ef0

Pull #477

circleci

jrgriffiniii
noop
Pull Request #477: Ensuring that DOIs which resolve to multiple Solr Documents explicitly prefer the Solr Document indexed from PDC Describe

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

2222 of 2406 relevant lines covered (92.35%)

180.73 hits per line

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

40.0
/spec/system/search_results_page_spec.rb
1
# frozen_string_literal: true
2

3
describe 'Search Results Page', type: :system, js: true do
1✔
4
  before do
1✔
5
    Blacklight.default_index.connection.delete_by_query('*:*')
10✔
6
    Blacklight.default_index.connection.commit
10✔
7
    data = file_fixture('search_results_items.xml').read
10✔
8
    indexer = DspaceIndexer.new(data)
10✔
9
    indexer.index
10✔
10
    page.driver.browser.manage.window.resize_to(2000, 2000)
10✔
11
  end
12

13
  it "renders expected fields" do
1✔
14
    visit '/?search_field=all_fields&q='
×
15

16
    expect(page).to have_link('Midplane neutral density profiles in the National Spherical Torus Experiment', href: '/catalog/78348')
×
17
    expect(page).to have_content 'Stotler, D.; F. Scotti; R.E. Bell; A. Diallo' # authors
×
18
    expect(page).to have_content 'Atomic and molecular density data in the outer midplane of NSTX' # abstract
×
19
  end
20

21
  describe "title searches" do
1✔
22
    it "finds record by title" do
1✔
23
      # Notice that the search is successful even with a slight variation in terms (profile vs profiles)
24
      visit '/?search_field=title&q=profile'
×
25
      expect(page).to have_link('Midplane neutral density profiles in the National Spherical Torus Experiment', href: '/catalog/78348')
×
26
    end
27
    it "does not find non-existing titles" do
1✔
28
      visit '/?search_field=title&q=crofile'
×
29
      expect(page).to have_content('No results found')
×
30
    end
31
  end
32

33
  describe "author searches" do
1✔
34
    it "finds record by author" do
1✔
35
      visit '/?search_field=author&q=podesta'
×
36
      expect(page).to have_link('Midplane neutral density profiles in the National Spherical Torus Experiment', href: '/catalog/78348')
×
37
    end
38

39
    it "finds record by author synonym" do
1✔
40
      visit '/?search_field=author&q=dan'
×
41
      expect(page).to have_content("Author(s):\nTrueman, Daniel")
×
42
      expect(page).to have_link('bitKlavier Grand Sample Library—Piano Bar Mic Image', href: '/catalog/123476')
×
43
    end
44
  end
45

46
  describe "bookmarks" do
1✔
47
    it "does not render bookmark checkboxes" do
1✔
48
      visit '/?search_field=author&q=podesta'
×
49
      expect(page).not_to have_css "div.toggle-bookmark"
×
50
    end
51
  end
52

53
  describe "facets" do
1✔
54
    it "shows expected facets" do
1✔
55
      visit '/?search_field=all_fields&q='
×
56
      domain_facet_html = '<div class="card facet-limit blacklight-domain_ssim ">'
×
57
      expect(page.html.include?(domain_facet_html)).to be true
×
58

59
      community_facet_html = '<div class="card facet-limit blacklight-communities_ssim ">'
×
60
      expect(page.html.include?(community_facet_html)).to be true
×
61

62
      type_facet_html = '<div class="card facet-limit blacklight-genre_ssim ">'
×
63
      expect(page.html.include?(type_facet_html)).to be true
×
64

65
      year_facet_html = '<div class="card facet-limit blacklight-year_available_itsi ">'
×
66
      expect(page.html.include?(year_facet_html)).to be true
×
67
    end
68

69
    it "shows collection facet for PPPL" do
1✔
70
      visit '/?f%5Bcommunities_ssim%5D%5B%5D=Princeton+Plasma+Physics+Laboratory'
×
71
      collection_facet_html = '<div class="card facet-limit blacklight-collection_tag_ssim ">'
×
72
      expect(page.html.include?(collection_facet_html)).to be true
×
73
    end
74

75
    it "shows collection facet for Music and Arts" do
1✔
76
      visit '/?f%5Bcommunities_ssim%5D%5B%5D=Music+and+Arts'
×
77
      collection_facet_html = '<div class="card facet-limit blacklight-collection_tag_ssim ">'
×
78
      expect(page.html.include?(collection_facet_html)).to be true
×
79
    end
80

81
    it "searches by the keyword facet even thought it is a hidden facet" do
1✔
82
      visit '/?f%5Bsubject_all_ssim%5D%5B%5D=Monte-Carlo+simulation'
×
83
      expect(page.html.include?("Keywords")).to be true
×
84
      expect(page.html.include?("Monte-Carlo simulation")).to be true
×
85
    end
86
  end
87
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