posts: fix exception when post has source like 'https://www.twitter.com/username'.

`twitter.com` sources worked but `www.twitter.com` didn't.

Also match the URL by class instead of by site name to ensure we match
the expected class.
This commit is contained in:
evazion
2022-03-20 20:43:22 -05:00
parent 1ad0e8688d
commit 7394660ba9
9 changed files with 10 additions and 8 deletions

View File

@@ -302,6 +302,7 @@ module Sources
assert_equal(source2, Sources::Strategies.normalize_source(source2))
assert_equal(source2, Sources::Strategies.normalize_source(source3))
assert_equal(source2, Sources::Strategies.normalize_source(source4))
assert_equal("https://www.twitter.com/irt_5433", Sources::Strategies.normalize_source("https://www.twitter.com/irt_5433"))
end
end
end