mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 23:39:32 +08:00
FIX: Don't cook user fields to apply watched words (#17590)
The previous method for reused the PrettyText logic which applied the watched word logic, but had the unwanted effect of cooking the text too. This meant that regular text values were converted to HTML. Follow up to commit 5a4c35f62714d2d72bc0ee57a10e08116bdc476a.
This commit is contained in:
@ -224,6 +224,16 @@ RSpec.describe User do
|
||||
it { is_expected.to be_valid }
|
||||
end
|
||||
|
||||
context "when user fields contain URL" do
|
||||
let(:value) { "https://discourse.org" }
|
||||
let(:user_field_value) { user.reload.user_fields[user_field.id.to_s] }
|
||||
|
||||
it "is not cooked" do
|
||||
user.save!
|
||||
expect(user_field_value).to eq "https://discourse.org"
|
||||
end
|
||||
end
|
||||
|
||||
context "with a multiselect user field" do
|
||||
fab!(:user_field) do
|
||||
Fabricate(:user_field, field_type: 'multiselect', show_on_profile: true) do
|
||||
|
Reference in New Issue
Block a user