posts: don't remove sound tag from Flash posts.

Fix a bug in 28237e2e0 where editing a Flash post would automatically remove the `sound` tag.
This commit is contained in:
evazion
2022-11-05 02:14:37 -05:00
parent 60efde0e68
commit c1623f3fcc
2 changed files with 14 additions and 2 deletions

View File

@@ -1269,7 +1269,7 @@ class PostTest < ActiveSupport::TestCase
@media_asset = MediaAsset.upload!("test/files/mp4/test-silent-audio.mp4")
@post.update!(md5: @media_asset.md5)
@post.reload.update!(tag_string: "sound")
assert_equal("animated tagme", @post.tag_string)
assert_equal("animated", @post.tag_string)
end
end
@@ -1282,6 +1282,15 @@ class PostTest < ActiveSupport::TestCase
end
end
context "a Flash file with the sound tag" do
should "not automatically remove the sound tag" do
@post = create(:post, file_ext: "swf", media_asset: build(:media_asset, file_ext: "swf"))
@post.update!(tag_string: "sound")
assert_equal("flash sound", @post.tag_string)
end
end
context "a post with a non-web source" do
should "automatically add the non-web_source tag" do
@post.update!(source: "this was once revealed to me in a dream")