FIX: Don't error out when trying to retrieve title and URL won't encode (#24660)

This commit is contained in:
Ted Johansson
2023-12-01 15:03:06 +08:00
committed by GitHub
parent aadc104817
commit 54e813e964
4 changed files with 23 additions and 2 deletions

View File

@ -60,6 +60,12 @@ RSpec.describe FinalDestination do
expect(fd.ignored).to eq(%w[test.localhost google.com meta.discourse.org])
end
it "raises an error when URL is too long to encode" do
expect {
FinalDestination.new("https://meta.discourse.org/" + "x" * UrlHelper::MAX_URL_LENGTH)
}.to raise_error(FinalDestination::UrlEncodingError)
end
describe ".resolve" do
it "has a ready status code before anything happens" do
expect(fd("https://eviltrout.com").status).to eq(:ready)