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

pulibrary / pdc_discovery / b3ff4e78-d88d-4913-960f-dcc0d9e55d1f

10 Oct 2023 04:33PM UTC coverage: 94.075% (-2.9%) from 96.965%
b3ff4e78-d88d-4913-960f-dcc0d9e55d1f

push

circleci

jrgriffiniii
wip

2604 of 2768 relevant lines covered (94.08%)

178.97 hits per line

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

57.14
/spec/system/search_pdc_results_page_spec.rb
1
# frozen_string_literal: true
2

3
describe 'Search Results PDC Page', type: :system, js: true do
1✔
4
  before do
1✔
5
    Blacklight.default_index.connection.delete_by_query('*:*')
1✔
6
    Blacklight.default_index.connection.commit
1✔
7
    Rails.configuration.pdc_discovery.index_pdc_describe = true
1✔
8
    pdc_files = Dir.entries(Rails.root.join("spec", "fixtures", "files", "pdc_describe_data", ""))
1✔
9
                   .reject { |name| [".", "..", "works.rss"].include?(name) }
70✔
10
    pdc_files.each do |name|
1✔
11
      stub_request(:get, "https://datacommons.princeton.edu/describe/works/#{name}")
67✔
12
        .to_return(status: 200, body: File.open(Rails.root.join("spec/fixtures/files/pdc_describe_data/#{name}")).read, headers: {})
13
    end
14
    stub_request(:get, "http://pdc_test_data/works.rss")
1✔
15
      .to_return(status: 200, body: File.open(Rails.root.join("spec", "fixtures", "files", "pdc_describe_data", "works.rss")).read, headers: {})
16
    indexer = DescribeIndexer.new(rss_url: "http://pdc_test_data/works.rss")
1✔
17
    indexer.index
1✔
18
    page.driver.browser.manage.window.resize_to(4000, 4000)
1✔
19
  end
20

21
  it "renders expected fields" do
1✔
22
    visit '/?search_field=all_fields&q='
1✔
23
    click_on "Source"
1✔
24
    click_on "pdc_describe"
×
25
    expect(page).to have_content("3D full wave fast wave modeling with realistic HHFW antenna geometry and SOL plasma in NSTX-U")
×
26
    click_on "Community"
×
27
    click_link "Princeton Plasma Physics Laboratory"
×
28
    expect(page).to have_content("Subcommunity")
×
29
    click_on("Subcommunity")
×
30
    expect(page).to have_content("Stellarators")
×
31
    expect(page).to have_content("more")
×
32
    click_link("more")
×
33
    expect(page).to have_content("System Studies")
×
34
    click_on("System Studies")
×
35
    expect(page).to have_content("Fusion Pilot Plant performance and the role of a Sustained High Power Density tokamak")
×
36
  end
37
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