mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
FIX: Wrong argument error being thrown in UrlHelper (#24506)
We were throwing ArgumentError in UrlHelper.normalised_encode, but it was incorrect -- we were passing ArgumentError.new 2 arguments which is not supported. Fix this and have a hint of which URL is causing the issue for debugging.
This commit is contained in:
@ -166,8 +166,10 @@ RSpec.describe UrlHelper do
|
||||
end
|
||||
|
||||
it "raises error if too long" do
|
||||
expect do UrlHelper.normalized_encode("https://#{"a" * 2_000}.com") end.to raise_error(
|
||||
long_url = "https://#{"a" * 2_000}.com"
|
||||
expect do UrlHelper.normalized_encode(long_url) end.to raise_error(
|
||||
ArgumentError,
|
||||
"URL starting with #{long_url[0..100]} is too long",
|
||||
)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user