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

pulibrary / pdc_discovery / 5af13607-7741-41ac-b110-c94c8a3ee0f0

pending completion
5af13607-7741-41ac-b110-c94c8a3ee0f0

Pull #441

circleci

hectorcorrea
Better error handling
Pull Request #441: Indexing to a new collection

99 of 99 new or added lines in 3 files covered. (100.0%)

1816 of 2220 relevant lines covered (81.8%)

95.45 hits per line

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

72.41
/spec/requests/catalog_spec.rb
1
# frozen_string_literal: true
2
require 'rails_helper'
1✔
3

4
RSpec.describe "Catalog", type: :request do
1✔
5
  let(:dspace_fixtures) { File.read(File.join(fixture_path, 'spherical_torus.xml')) }
5✔
6
  let(:indexer) do
1✔
7
    DspaceIndexer.new(dspace_fixtures)
4✔
8
  end
9
  before do
1✔
10
    indexer.index
4✔
11
  end
12

13
  describe "GET /doi/:doi" do
1✔
14
    let(:doi) { "doi:10.1088/0029-5515/57/1/016034" }
1✔
15
    let(:document_id) { "84912" }
1✔
16

17
    it "retrieves Solr Documents using a given DOI" do
1✔
18
      get "/doi/#{doi}"
×
19
      expect(response).to redirect_to(solr_document_path(id: document_id))
×
20
    end
21

22
    context "when passing only a segment of the DOI" do
1✔
23
      let(:doi) { "10.1088/0029-5515/57/1/016034" }
1✔
24

25
      it "retrieves Solr Documents using a given DOI" do
1✔
26
        get "/doi/#{doi}"
×
27
        expect(response).to redirect_to(solr_document_path(id: document_id))
×
28
      end
29
    end
30
  end
31

32
  describe "GET /ark/:ark" do
1✔
33
    let(:ark) { "http://arks.princeton.edu/ark:/88435/dsp01kd17cw34n" }
1✔
34
    let(:document_id) { "84912" }
1✔
35
    it "retrieves Solr Documents using a given ARK" do
1✔
36
      get "/ark/#{ark}"
×
37
      expect(response).to redirect_to(solr_document_path(id: document_id))
×
38
    end
39

40
    context "when passing only a segment of the ARK" do
1✔
41
      let(:ark) { "88435/dsp01kd17cw34n" }
1✔
42

43
      it "retrieves Solr Documents using a given ARK" do
1✔
44
        get "/ark/#{ark}"
×
45
        expect(response).to redirect_to(solr_document_path(id: document_id))
×
46
      end
47
    end
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