Fix #4462: "You have already favorited this post" on upload.

Make adding the fav:self metatag ignore all errors, including when the
post was already favorited before editing the post.
This commit is contained in:
evazion
2020-06-30 14:26:47 -05:00
parent 048bc7faf5
commit 1a8729e0d9
2 changed files with 17 additions and 2 deletions

View File

@@ -954,6 +954,14 @@ class PostTest < ActiveSupport::TestCase
@post.update(tag_string: "aaa -fav:self")
assert_equal("", @post.fav_string)
end
should "not fail when the fav: metatag is used twice" do
@post.update(tag_string: "aaa fav:self fav:me")
assert_equal("fav:#{@user.id}", @post.fav_string)
@post.update(tag_string: "aaa -fav:self -fav:me")
assert_equal("", @post.fav_string)
end
end
context "for a child" do