sources: remove image_url method from base strategy.
Remove the `image_url` method from source strategies. This method would return only the first image if a source had multiple images. The `image_urls` method should be used instead. Tests were the main place that still used `image_url` instead of `image_urls`. Also make post replacements return an error if replacing with a source that contains multiple images, instead of just blindly replacing the post with the first image in the source.
This commit is contained in:
@@ -29,8 +29,8 @@ module Sources
|
||||
end
|
||||
|
||||
should "get the image url" do
|
||||
assert_equal("https://pictures.hentai-foundry.com/a/Afrobull/795025/Afrobull-795025-kuroeda.png", @image_1.image_url)
|
||||
assert_equal("https://pictures.hentai-foundry.com/a/Afrobull/795025/Afrobull-795025-kuroeda.png", @image_2.image_url)
|
||||
assert_equal(["https://pictures.hentai-foundry.com/a/Afrobull/795025/Afrobull-795025-kuroeda.png"], @image_1.image_urls)
|
||||
assert_equal(["https://pictures.hentai-foundry.com/a/Afrobull/795025/Afrobull-795025-kuroeda.png"], @image_2.image_urls)
|
||||
end
|
||||
|
||||
should "get the canonical url" do
|
||||
@@ -39,8 +39,8 @@ module Sources
|
||||
end
|
||||
|
||||
should "download an image" do
|
||||
assert_downloaded(1_349_887, @image_1.image_url)
|
||||
assert_downloaded(1_349_887, @image_2.image_url)
|
||||
assert_downloaded(1_349_887, @image_1.image_urls.sole)
|
||||
assert_downloaded(1_349_887, @image_2.image_urls.sole)
|
||||
end
|
||||
|
||||
should "get the tags" do
|
||||
|
||||
Reference in New Issue
Block a user