FIX: Allow queued posts from deleted users to be rejected

This commit is contained in:
Robin Ward
2019-04-03 11:40:32 -04:00
parent bb2005d466
commit 1bce97a596
2 changed files with 13 additions and 2 deletions

View File

@ -505,5 +505,16 @@ describe StaffActionLogger do
expect(user_history.action).to eq(UserHistory.actions[:post_rejected])
expect(user_history.details).to include(reviewable.payload['raw'])
end
it "works if the user was destroyed" do
reviewable.created_by.destroy
reviewable.reload
expect { log_post_rejected }.to change { UserHistory.count }.by(1)
user_history = UserHistory.last
expect(user_history.action).to eq(UserHistory.actions[:post_rejected])
expect(user_history.details).to include(reviewable.payload['raw'])
end
end
end