azohra/ferris

Url is not parsed properly?

luc2016 opened this issue · 2 comments

if url doesn't contains 'http://', uri_parse(url) will return nil, and check_urlwill throw an error.

[1] pry(#<Pages::Home>)> path='google.com'
=> "google.com"

[2] pry(#<Pages::Home>)> uri_parse(path)
=> nil

[3] pry(#<Pages::Home>)> path='http://google.com'
=> "http://google.com"

[4] pry(#<Pages::Home>)> uri_parse(path)
=> "google.com"

The consequence is if we specify our URL as google.ca rather than http://google.ca, the loaded? method won't work.

we need to decide if we want to allow incorrect URI's into the method.

closing as we have agreed to not allow incorrect URI's