mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Generate webhook payloads before destroy events (#6325)
This commit is contained in:
committed by
Guo Xiang Tan
parent
5b630f3188
commit
8430ea927e
@@ -20,6 +20,10 @@ RSpec.describe Jobs::FixPrimaryEmailsForStagedUsers do
|
||||
|
||||
UserEmail.delete_all
|
||||
|
||||
# since we removing `user_emails` table the `user.primary_email` value will be nil.
|
||||
# it will raise error in https://github.com/discourse/discourse/blob/d0b027d88deeabf8bc105419f7d3fae0087091cd/app/models/user.rb#L942
|
||||
WebHook.stubs(:generate_payload).returns(nil)
|
||||
|
||||
expect { described_class.new.execute_onceoff({}) }
|
||||
.to change { User.count }.by(-2)
|
||||
.and change { staged_user.posts.count }.by(3)
|
||||
|
||||
Reference in New Issue
Block a user