-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WoS DOI Search #242
WoS DOI Search #242
Conversation
f5cb3f8
to
f4d3d4b
Compare
2011795
to
7e36e90
Compare
558c2df
to
2454cd9
Compare
2454cd9
to
2683feb
Compare
2683feb
to
e586466
Compare
# Return a unique DOI match or nothing, because the WoS API does partial string matching | ||
# on the `DO` field. When the result set is only one record, it's likely to be a good match; but | ||
# otherwise the results could be nonsense. | ||
return records if records.count == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just reminding myself -- this return will prevent the following line from executing when reached, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when records.count == 1
it returns records
and short-circuits the rest of the block.
spec/lib/wos_queries_spec.rb
Outdated
savon.expects(:search).with(message: :any).returns(wos_search_by_doi_mismatch_response) | ||
result = wos_queries.search_by_doi(doi) | ||
expect(result).to be_an WosRecords | ||
expect(result).to be_empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
took me a second to understand why the same DOI passed in the two tests led to different results ... which of course works since the response is mocked differently as needed (i.e. the actual value of the incoming DOI is irrelevant for the tests) - maybe a small comment next to the let(:doi) statement to point that out?
e586466
to
8a14421
Compare
Fix #243
WoS DOI queries, see
https://github.com/sul-dlss/sul_pub/wiki/Web-Of-Science-API-Queries#find-doi-records
Related work: