UX: Skip applying link-type watched words to user custom fields (#20465)

We currently apply type: :link watched words to custom user fields. This makes the user card pretty ugly because we don't allow html / links there. Additionally, the admin UI also does not say that we apply this to custom user fields, but only words in posts.

So this PR is to remove the replacement of link-type watch words for custom user fields.
This commit is contained in:
Natalie Tay
2023-03-01 10:43:34 +08:00
committed by GitHub
parent d3a1b09361
commit 44b7706a2b
4 changed files with 79 additions and 31 deletions

View File

@ -362,6 +362,23 @@ RSpec.describe User do
end
end
end
context "when watched words are of type 'link'" do
let(:value) { "don't replace me" }
let!(:replace_word) do
Fabricate(
:watched_word,
word: "replace",
replacement: "touch",
action: WatchedWord.actions[:link],
)
end
it "does not replace anything" do
user.save!
expect(user_field_value).to eq value
end
end
end
context "when user fields do not contain watched words" do