-
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.
Exclude swagger spec from rubocop empty example
Describe catalog api
- Loading branch information
1 parent
5bda0b6
commit 7d3d5f1
Showing
4 changed files
with
40 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
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 |
---|---|---|
@@ -1,3 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'swagger_helper' | ||
|
||
RSpec.describe 'catalog' do | ||
before do | ||
stub_request(:get, 'http://lib-solr8-prod.princeton.edu:8983/solr/catalog-alma-production/select?facet=false&fl=id,title_display,author_display,pub_created_display,format,holdings_1display&q=rubix&rows=3&sort=score%20desc,%20pub_date_start_sort%20desc,%20title_sort%20asc') | ||
.to_return(status: 200, body: file_fixture('solr/catalog/rubix.json')) | ||
end | ||
|
||
path '/search/catalog?query={query}' do | ||
parameter name: 'query', in: :path, type: :string, description: 'A string to query the Catalog' | ||
|
||
get('/search/catalog?query={query}') do | ||
tags 'Catalog' | ||
consumes 'application/json' | ||
produces 'application/json' | ||
description 'Searches the Catalog using a query term' | ||
|
||
response(200, 'successful') do | ||
let(:query) { 'rubix' } | ||
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