uploads: fix not being able to change the source field during upload.

Fix not being able to change the post's source when submitting the
upload. For example, if you were uploading a Twitter image from a direct
Twitter image URL, and you tried to change the source to the tweet URL
on the upload page before creating the post, then the source would be
ignored when the post was created.
This commit is contained in:
evazion
2022-01-29 22:09:23 -06:00
parent 892c3899a8
commit dadd6aed47
3 changed files with 11 additions and 2 deletions

View File

@@ -663,6 +663,13 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
assert_equal("tagme", @post.tag_string)
end
should "set the source" do
@post = create_post!(source: "https://www.example.com")
assert_redirected_to @post
assert_equal("https://www.example.com", @post.source)
end
should "autoban the post when it is tagged banned_artist" do
@post = create_post!(tag_string: "banned_artist")
assert_equal(true, @post.is_banned?)