mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 09:33:37 +08:00
111a502231
"Rejecting" a user in the queue is equivalent to deleting them, which would then making it impossible to review rejected users. Now we store information about the user in the payload so if they are deleted things still display in the Rejected view. Secondly, if a user is destroyed outside of the review queue, it will now automatically "Reject" that queue item.
20 lines
614 B
Ruby
20 lines
614 B
Ruby
require 'rails_helper'
|
|
require_dependency 'jobs/regular/create_user_reviewable'
|
|
|
|
describe Jobs::CreateUserReviewable do
|
|
|
|
let(:user) { Fabricate(:user) }
|
|
|
|
it "creates the reviewable" do
|
|
described_class.new.execute(user_id: user.id)
|
|
|
|
reviewable = Reviewable.find_by(target: user)
|
|
expect(reviewable).to be_present
|
|
expect(reviewable.pending?).to eq(true)
|
|
expect(reviewable.reviewable_scores).to be_present
|
|
expect(reviewable.payload['username']).to eq(user.username)
|
|
expect(reviewable.payload['name']).to eq(user.name)
|
|
expect(reviewable.payload['email']).to eq(user.email)
|
|
end
|
|
end
|