• 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

77.42
/spec/system/embargoed_document_spec.rb
1
# frozen_string_literal: true
2

3
describe 'Embargoed Document page', type: :system, js: true do
1✔
4
  context "when the Solr Document has an embargo date" do
1✔
5
    # This redundancy is required for consistent testing
6
    let(:embargo_resource) { item_file_fixture.read }
7✔
7
    let(:rss_feed) { file_fixture("works.rss").read }
7✔
8
    let(:rss_url) { "https://pdc-describe-prod.princeton.edu/describe/works.rss" }
7✔
9
    let(:indexer) { DescribeIndexer.new(rss_url: rss_url) }
7✔
10
    let(:solr_response) do
1✔
11
      Blacklight.default_index.connection.get 'select', params: { q: '*:*' }
×
12
    end
13

14
    before do
1✔
15
      stub_request(:get, "https://pdc-describe-prod.princeton.edu/describe/works.rss")
6✔
16
        .to_return(status: 200, body: rss_feed, headers: {})
17
      stub_request(:get, "https://pdc-describe-prod.princeton.edu/describe/works/6.json")
6✔
18
        .to_return(status: 200, body: embargo_resource, headers: {})
19
      stub_request(:get, "https://pdc-describe-prod.princeton.edu/describe/works/20.json")
6✔
20
        .to_return(status: 200, body: embargo_resource, headers: {})
21

22
      Blacklight.default_index.connection.delete_by_query("*:*")
6✔
23
      Blacklight.default_index.connection.commit
6✔
24
      indexer.index
6✔
25
    end
26

27
    context "and the PDC Describe Work is under active embargo" do
1✔
28
      let(:document_id) { "doi-10-34770-r75s-9j74-active-embargo" }
4✔
29
      let(:item_file_fixture) { file_fixture("pdc_describe_active_embargo.json") }
4✔
30
      it "renders a message to the client expressing this and detailing the embargo date" do
1✔
31
        visit "/catalog/#{document_id}"
3✔
32
        embargo_message_header = find(:css, '.document-embargo-heading', match: :first).text
×
33
        expect(embargo_message_header).to eq("File(s) associated with this object are embargoed until 2033-09-13.")
×
34
        embargo_element = find(:css, '#no_files', match: :first).text
×
35
        expect(embargo_element).to eq("File(s) associated with this object are embargoed until 2033-09-13.")
×
36
      end
37
    end
38

39
    context "and the PDC Describe Work is under an expired embargo" do
1✔
40
      let(:document_id) { "doi-10-34770-r75s-9j74-expired-embargo" }
4✔
41
      let(:item_file_fixture) { file_fixture("pdc_describe_expired_embargo.json") }
4✔
42
      it "does not render the embargo message" do
1✔
43
        visit "/catalog/#{document_id}"
3✔
44
        embargo_message_included = page.html.include?("File(s) associated with this object are embargoed until 2033-09-13T00:00:00Z.")
×
45
        expect(embargo_message_included).not_to be true
×
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