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