Skip to content

Commit

Permalink
fix: Avoid ssl certificate verification
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Jan 4, 2018
1 parent eebf0f2 commit fb59e78
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec/links_spec.rb
Expand Up @@ -32,13 +32,14 @@ def duplicated_links_error(links)

def broken_links_error(link, response)
"Link #{link} seems not be reacheable. Could you double check?. \n" +
"Status #{response.status} Cause #{response.body[0..400]}"
"Status #{response&.status} Cause #{response&.body[0..400]}"
end

def request(link)
Faraday.get do |req|
req.url link
req.params['User-Agent'] = 'Awesome4Girls test script'
begin
Faraday.new(link, { ssl: { verify: false } }).get('/')
rescue => e
fail "Request failed for #{link}. Cause: #{e}"
end
end
end

0 comments on commit fb59e78

Please sign in to comment.