nijie: add canonical url tests.
This commit is contained in:
@@ -1081,6 +1081,17 @@ class UploadServiceTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "for nijie" do
|
||||
should "record the canonical source" do
|
||||
page_url = "https://nijie.info/view.php?id=213043"
|
||||
image_url = "https://pic03.nijie.info/nijie_picture/728995_20170505014820_0.jpg"
|
||||
upload = FactoryBot.create(:jpg_upload, file_size: 1000, md5: "12345", file_ext: "jpg", image_width: 100, image_height: 100, source: image_url, referer_url: page_url)
|
||||
|
||||
post = UploadService.new({}).create_post_from_upload(upload)
|
||||
assert_equal(page_url, post.source)
|
||||
end
|
||||
end
|
||||
|
||||
context "for an image" do
|
||||
setup do
|
||||
@upload = FactoryBot.create(:source_upload, file_size: 1000, md5: "12345", file_ext: "jpg", image_width: 100, image_height: 100)
|
||||
|
||||
Reference in New Issue
Block a user