uploads: fix error when source doesn't have any images.
Fix an error when trying to upload a source that doesn't have any images, for example a Twitter post with no images.
This commit is contained in:
@@ -258,6 +258,16 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
end
|
||||
|
||||
context "for a source that doesn't contain any images" do
|
||||
should "fail" do
|
||||
create_upload!("https://twitter.com/danboorubot/status/923612084616577024", user: @user)
|
||||
|
||||
assert_response 201
|
||||
assert_equal(true, Upload.last.is_errored?)
|
||||
assert_match("doesn't contain any images", Upload.last.error)
|
||||
end
|
||||
end
|
||||
|
||||
should "work for a source URL containing unicode characters" do
|
||||
source1 = "https://cdn.donmai.us/original/d3/4e/d34e4cf0a437a5d65f8e82b7bcd02606.jpg?one=東方&two=a%20b"
|
||||
source2 = "https://cdn.donmai.us/original/d3/4e/d34e4cf0a437a5d65f8e82b7bcd02606.jpg?one=%E6%9D%B1%E6%96%B9&two=a%20b"
|
||||
|
||||
Reference in New Issue
Block a user