mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 21:04:33 +08:00
DEV: Update display name in new quote format - Part 2 (#22104)
This change adds support retroactively updating display names in the new quote format when the user's name is changed. It happens through a background job that is triggered by a callback when a user is saved with a new name.
This commit is contained in:
@ -159,6 +159,19 @@ RSpec.describe User do
|
||||
expect(SidebarSectionLink.exists?(linkable_type: "Tag", user_id: user.id)).to eq(false)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#change_display_name" do
|
||||
it "enqueues a job to retroactively update display name in quotes, etc." do
|
||||
expect_enqueued_with(
|
||||
job: :change_display_name,
|
||||
args: {
|
||||
user_id: user.id,
|
||||
old_name: "Bruce Wayne",
|
||||
new_name: "Batman",
|
||||
},
|
||||
) { user.update(name: "Batman") }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "Validations" do
|
||||
|
Reference in New Issue
Block a user