DEV: Simplify client and server side code to support removing tags.

Follow up to 834c86678f.
This commit is contained in:
Guo Xiang Tan
2019-05-17 16:39:20 +08:00
parent 678a9a61c4
commit 148bfc9be5
5 changed files with 47 additions and 31 deletions
-8
View File
@@ -677,14 +677,6 @@ describe PostRevisor do
expect(post.topic.tags.size).to eq(0)
end
it "can remove all tags using tags_empty_array" do
topic.tags = [Fabricate(:tag, name: "stuff")]
result = subject.revise!(user, raw: "lets totally update the body", tags_empty_array: "true")
expect(result).to eq(true)
post.reload
expect(post.topic.tags.size).to eq(0)
end
it "can't add staff-only tags" do
create_staff_tags(['important'])
result = subject.revise!(user, raw: "lets totally update the body", tags: ['important', 'stuff'])