• 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

62.86
/spec/system/show_pdc_describe_record_spec.rb
1
# frozen_string_literal: true
2

3
describe 'Show PDC Page', type: :system, js: true do
1✔
4
  before do
1✔
5
    Blacklight.default_index.connection.delete_by_query('*:*')
15✔
6
    Blacklight.default_index.connection.commit
15✔
7
    Rails.configuration.pdc_discovery.index_pdc_describe = true
15✔
8
    pdc_files = Dir.entries(Rails.root.join("spec", "fixtures", "files", "pdc_describe_data", ""))
15✔
9
                   .reject { |name| [".", "..", "works.rss"].include?(name) }
1,050✔
10
    pdc_files.each do |name|
15✔
11
      stub_request(:get, "https://datacommons.princeton.edu/describe/works/#{name}")
1,005✔
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")
15✔
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")
15✔
17
    indexer.index
15✔
18
  end
19

20
  it "renders total file size" do
1✔
21
    visit '/catalog/doi-10-34770-bm4s-t361'
3✔
22
    expect(page).to have_content("Total Size")
×
23
    expect(page).to have_content("373 MB")
×
24
  end
25
  it "renders rights statement" do
1✔
26
    visit '/catalog/doi-10-34770-bm4s-t361'
3✔
27
    expect(page).to have_content("Creative Commons Attribution 4.0 International (CC BY)")
×
28
    expect(page).to have_link('CC BY', href: 'https://creativecommons.org/licenses/by/4.0/')
×
29
  end
30
  it 'has the README files first' do
1✔
31
    visit '/catalog/doi-10-34770-bm4s-t361'
3✔
32
    first_filename_spot = find(:css, '#files-table>tbody>tr:first-child>td', match: :first).text
×
33
    expect(first_filename_spot).to eq("Fig11b_readme.hdf")
×
34
  end
35
  it 'sorts files by name initially' do
1✔
36
    visit '/catalog/doi-10-34770-bm4s-t361'
3✔
37
    third_filename_spot = find(:xpath, "//table[@id='files-table']/tbody/tr[3]/td[1]").text
×
38
    expect(third_filename_spot).to eq("Fig10a.hdf")
×
39
  end
40
  it 'correctly sorts by file size' do
1✔
41
    visit '/catalog/doi-10-34770-bm4s-t361'
3✔
42
    first_filename_spot = find(:css, '#files-table>tbody>tr:first-child>td', match: :first).text
×
43
    expect(first_filename_spot).to eq("Fig11b_readme.hdf")
×
44
    find(:xpath, "//thead/tr/th[3]").click
×
45
    first_filename_spot = find(:css, '#files-table>tbody>tr:first-child>td', match: :first).text
×
46
    # "readme.txt" is the smallest file and so now it is first
47
    expect(first_filename_spot).to eq("readme.txt")
×
48
  end
49
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