Skip to content

Commit

Permalink
✅ Update raise statement to resolve spec failures
Browse files Browse the repository at this point in the history
This commit should fix the cause of spec failures in has_matchers_decorator_spec.rb
  • Loading branch information
ShanaLMoore committed Apr 25, 2024
1 parent 21be5fa commit f685f92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/concerns/bulkrax/has_matchers_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def geonames_lookup(result)
response = Net::HTTP.get_response(uri)
data = JSON.parse(response.body)

raise 'Invalid user. Check that geonames_username is set in the Site instance Account settings' if data['status']['message'] == 'invalid user'
return if data.blank?

raise 'Invalid user. Check that geonames_username is set in the Site instance Account settings' if data.fetch('status', {})['message'] == 'invalid user'

geoname = data['geonames'].first

Expand Down

0 comments on commit f685f92

Please sign in to comment.