Fix #5072: Fandom source normalization is wrong
This commit is contained in:
15
test/unit/sources/fandom_test.rb
Normal file
15
test/unit/sources/fandom_test.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'test_helper'
|
||||
|
||||
module Sources
|
||||
class FandomTest < ActiveSupport::TestCase
|
||||
context "Fandom" do
|
||||
should "convert fandom image urls to page urls" do
|
||||
assert_equal("https://valkyriecrusade.fandom.com/wiki/Gallery?file=Crimson_Hatsune_H.png", Source::URL.page_url("https://vignette.wikia.nocookie.net/valkyriecrusade/images/c/c5/Crimson_Hatsune_H.png/revision/latest?cb=20180702031954"))
|
||||
assert_equal("https://ishtaria.fandom.com/wiki/Gallery?file=Union-List.png", Source::URL.page_url("https://static.wikia.nocookie.net/age-of-ishtaria/images/f/f9/Union-List.png/revision/latest/scale-to-width-down/670?cb=20141219153314"))
|
||||
assert_equal("https://atelier.fandom.com/wiki/Gallery?file=Marie_(Front_Page_Art).jpg", Source::URL.page_url("https://static.wikia.nocookie.net/atelierseries/images/2/22/Marie_%28Front_Page_Art%29.jpg/revision/latest/scale-to-width-down/670?cb=20130129113100"))
|
||||
assert_equal("https://senrankagura.fandom.com/wiki/Gallery?file=Kagurapedia_Header.png", Source::URL.page_url("https://static.wikia.nocookie.net/kagura/images/9/9f/Kagurapedia_Header.png/revision/latest/scale-to-width-down/650?cb=20171016220119"))
|
||||
assert_equal("https://genshin-impact.fandom.com/wiki/Gallery?file=Character_Kamisato_Ayato_Card.png", Source::URL.page_url("https://static.wikia.nocookie.net/gensin-impact/images/2/22/Character_Kamisato_Ayato_Card.png/revision/latest/scale-to-width-down/281?cb=20220204094446"))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -82,11 +82,6 @@ module Sources
|
||||
assert_equal("https://gelbooru.com/index.php?page=post&s=list&tags=md5:0b3ae5e225072b8e391c827cb470d29c", Source::URL.page_url(source3))
|
||||
end
|
||||
|
||||
should "normalize wikia links" do
|
||||
source = "https://vignette.wikia.nocookie.net/valkyriecrusade/images/c/c5/Crimson_Hatsune_H.png/revision/latest?cb=20180702031954"
|
||||
assert_equal("https://valkyriecrusade.fandom.com/wiki/Gallery?file=Crimson_Hatsune_H.png", Source::URL.page_url(source))
|
||||
end
|
||||
|
||||
should "normalize e-shuushuu links" do
|
||||
source = "http://e-shuushuu.net/images/2014-07-22-662472.png"
|
||||
assert_equal("https://e-shuushuu.net/image/662472", Source::URL.page_url(source))
|
||||
|
||||
Reference in New Issue
Block a user