FIX: Make autotag watched words case insensitive (#13043)

* FIX: Hide tag watched words if tagging is disabled

These 'autotag' words were shown even if tagging was disabled.

* FIX: Make autotag watched words case insensitive

This commit also fixes the bug when no tag was applied if no other tag
was already present.
This commit is contained in:
Bianca Nenciu
2021-05-14 16:52:10 +03:00
committed by GitHub
parent 0e6a8757fe
commit 3a1b05f219
5 changed files with 26 additions and 27 deletions

View File

@@ -503,10 +503,10 @@ describe PostCreator do
context "without regular expressions" do
it "works" do
Fabricate(:watched_word, action: WatchedWord.actions[:tag], word: "hello", replacement: "greetings , hey")
Fabricate(:watched_word, action: WatchedWord.actions[:tag], word: "HELLO", replacement: "greetings , hey")
@post = creator_with_tags.create
expect(@post.topic.tags.map(&:name)).to match_array(tag_names + ['greetings', 'hey'])
@post = creator.create
expect(@post.topic.tags.map(&:name)).to match_array(['greetings', 'hey'])
end
it "does not treat as regular expressions" do