Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/CDL-Dryad/dryad into peer…
Browse files Browse the repository at this point in the history
…-review
  • Loading branch information
briri committed Jun 17, 2019
2 parents 22fd1f8 + 713f0a6 commit 247edff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
19 changes: 1 addition & 18 deletions public/images/logo_ucla.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions spec/mocks/ror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@ module Mocks
module Ror

def mock_ror!(user = nil)
stub_ror_heartbeat_check
stub_ror_name_lookup(name: user.present? && user.affiliation.present? ? user.affiliation.long_name : nil)
stub_ror_id_lookup(university: user.present? && user.affiliation.present? ? user.affiliation.long_name : nil)
end

def stub_ror_heartbeat_check
stub_request(:get, 'https://api.ror.org/heartbeat')
.with(
headers: {
'Accept' => '*/*',
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'User-Agent' => 'Ruby'
}
)
.to_return(status: 200, body: '', headers: {})
end

# rubocop:disable Metrics/MethodLength
def stub_ror_id_lookup(university: Faker::Educator.university, country: 'United States of America')
# Mock a request for a specific ROR Organization
Expand Down

0 comments on commit 247edff

Please sign in to comment.