rspec-coverage #22

Merged
bucky merged 13 commits from rspec-coverage into master 2023-10-12 23:49:49 -07:00
Showing only changes of commit 144731062b - Show all commits
+14
View File
@@ -34,6 +34,20 @@ class App < Roda
flash['message'] = "Please enter a valid URL";
r.redirect '/'
end
begin
OpenURI.open_uri(url)
rescue URI::BadURIError
flash['message'] = "Invalid URL"
r.redirect '/'
rescue OpenURI::HTTPError
flash['message'] = "URL not found"
r.redirect '/'
rescue SocketError => e
flash['message'] = "URL does not resolve"
r.redirect '/'
end
if links.filter(:url => url).first.nil?
code = SecureRandom.urlsafe_base64 4
links.insert(url: url, code: code)