-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[API docs] Add Dpul, Findingaids, Pulmap
part of #50
- Loading branch information
1 parent
8ff67e5
commit 52d0119
Showing
5 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'swagger_helper' | ||
|
||
RSpec.describe 'dpul' do | ||
before do | ||
stub_request(:get, 'http://lib-solr8-prod.princeton.edu:8983/solr/dpul-production/select?facet=false&fl=id,readonly_title_ssim,readonly_creator_ssim,readonly_publisher_ssim,readonly_format_ssim,readonly_collections_tesim&q=cats&rows=3&sort=score%20desc') | ||
.to_return(status: 200, body: file_fixture('solr/dpul/cats.json')) | ||
end | ||
|
||
path '/search/dpul?query={query}' do | ||
parameter name: 'query', in: :path, type: :string, description: 'A string to query Dpul' | ||
|
||
get('/search/dpul?query={query}') do | ||
tags 'Dpul' | ||
consumes 'application/json' | ||
produces 'application/json' | ||
description 'Searches Dpul using a query term' | ||
|
||
response(200, 'successful') do | ||
let(:query) { 'cats' } | ||
after do |example| | ||
example.metadata[:response][:content] = { | ||
'application/json' => { | ||
example: JSON.parse(response.body, symbolize_names: true) | ||
} | ||
} | ||
end | ||
|
||
run_test! | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'swagger_helper' | ||
|
||
RSpec.describe 'findingaids' do | ||
before do | ||
stub_request(:get, 'http://lib-solr8-prod.princeton.edu:8983/solr/pulfalight-production/select?facet=false&fl=id,collection_ssm,creator_ssm,level_sim,scopecontent_ssm,repository_ssm,extent_ssm,accessrestrict_ssm&q=cats&rows=3&sort=score%20desc,%20title_sort%20asc&fq=level_sim:Collection') | ||
.to_return(status: 200, body: file_fixture('solr/findingaids/cats.json')) | ||
end | ||
|
||
path '/search/findingaids?query={query}' do | ||
parameter name: 'query', in: :path, type: :string, description: 'A string to query Findingaids' | ||
|
||
get('/search/findingaids?query={query}') do | ||
tags 'Findingaids' | ||
consumes 'application/json' | ||
produces 'application/json' | ||
description 'Searches Findingaids using a query term' | ||
|
||
response(200, 'successful') do | ||
let(:query) { 'cats' } | ||
after do |example| | ||
example.metadata[:response][:content] = { | ||
'application/json' => { | ||
example: JSON.parse(response.body, symbolize_names: true) | ||
} | ||
} | ||
end | ||
|
||
run_test! | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'swagger_helper' | ||
|
||
RSpec.describe 'pulmap' do | ||
before do | ||
stub_request(:get, 'http://lib-solr8-prod.princeton.edu:8983/solr/pulmap/select?facet=false&fl=uuid,dc_title_s,dc_creator_sm,dc_publisher_s,dc_format_s,dc_description_s,dc_rights_s,layer_geom_type_s&q=scribner&rows=3&sort=score%20desc') | ||
.to_return(status: 200, body: file_fixture('solr/pulmap/scribner.json')) | ||
end | ||
|
||
path '/search/pulmap?query={query}' do | ||
parameter name: 'query', in: :path, type: :string, description: 'A string to query Pulmap' | ||
|
||
get('/search/pulmap?query={query}') do | ||
tags 'Pulmap' | ||
consumes 'application/json' | ||
produces 'application/json' | ||
description 'Searches Pulmap using a query term' | ||
|
||
response(200, 'successful') do | ||
let(:query) { 'scribner' } | ||
after do |example| | ||
example.metadata[:response][:content] = { | ||
'application/json' => { | ||
example: JSON.parse(response.body, symbolize_names: true) | ||
} | ||
} | ||
end | ||
|
||
run_test! | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters