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:
@@ -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?)
|
||||
|
||||
Reference in New Issue
Block a user