2019-04-30 08:27:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-10-11 17:41:23 +08:00
|
|
|
require 'rails_helper'
|
2013-04-12 04:04:20 +08:00
|
|
|
|
|
|
|
describe UserDestroyer do
|
2018-03-15 03:11:35 +08:00
|
|
|
|
2019-05-07 11:12:20 +08:00
|
|
|
fab!(:user) { Fabricate(:user) }
|
|
|
|
fab!(:admin) { Fabricate(:admin) }
|
2018-03-15 03:11:35 +08:00
|
|
|
|
2013-04-12 04:04:20 +08:00
|
|
|
describe 'new' do
|
|
|
|
it 'raises an error when user is nil' do
|
|
|
|
expect { UserDestroyer.new(nil) }.to raise_error(Discourse::InvalidParameters)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'raises an error when user is not a User' do
|
|
|
|
expect { UserDestroyer.new(5) }.to raise_error(Discourse::InvalidParameters)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'destroy' do
|
|
|
|
before do
|
|
|
|
@admin = Fabricate(:admin)
|
2019-04-23 17:49:05 +08:00
|
|
|
@user = Fabricate(:user_with_secondary_email)
|
2013-04-12 04:04:20 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'raises an error when user is nil' do
|
|
|
|
expect { UserDestroyer.new(@admin).destroy(nil) }.to raise_error(Discourse::InvalidParameters)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'raises an error when user is not a User' do
|
|
|
|
expect { UserDestroyer.new(@admin).destroy('nothing') }.to raise_error(Discourse::InvalidParameters)
|
|
|
|
end
|
|
|
|
|
2014-02-14 00:42:35 +08:00
|
|
|
it 'raises an error when regular user tries to delete another user' do
|
|
|
|
expect { UserDestroyer.new(@user).destroy(Fabricate(:user)) }.to raise_error(Discourse::InvalidAccess)
|
|
|
|
end
|
|
|
|
|
2013-07-25 01:48:55 +08:00
|
|
|
shared_examples "successfully destroy a user" do
|
|
|
|
it 'should delete the user' do
|
|
|
|
expect { destroy }.to change { User.count }.by(-1)
|
2013-04-12 04:04:20 +08:00
|
|
|
end
|
|
|
|
|
2013-07-25 01:48:55 +08:00
|
|
|
it 'should return the deleted user record' do
|
|
|
|
return_value = destroy
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(return_value).to eq(@user)
|
|
|
|
expect(return_value).to be_destroyed
|
2013-04-12 04:04:20 +08:00
|
|
|
end
|
|
|
|
|
2013-07-25 01:48:55 +08:00
|
|
|
it 'should log the action' do
|
2013-07-26 06:04:51 +08:00
|
|
|
StaffActionLogger.any_instance.expects(:log_user_deletion).with(@user, anything).once
|
2013-07-25 01:48:55 +08:00
|
|
|
destroy
|
2013-04-12 04:04:20 +08:00
|
|
|
end
|
2017-10-03 23:28:41 +08:00
|
|
|
|
|
|
|
it "should not log the action if quiet is true" do
|
|
|
|
expect {
|
|
|
|
UserDestroyer.new(@admin).destroy(@user, destroy_opts.merge(quiet: true))
|
|
|
|
}.to_not change { UserHistory.where(action: UserHistory.actions[:delete_user]).count }
|
|
|
|
end
|
2018-07-23 15:49:49 +08:00
|
|
|
|
|
|
|
it 'triggers a extensibility event' do
|
|
|
|
event = DiscourseEvent.track_events { destroy }.last
|
|
|
|
|
|
|
|
expect(event[:event_name]).to eq(:user_destroyed)
|
|
|
|
expect(event[:params].first).to eq(@user)
|
|
|
|
end
|
2013-04-12 04:04:20 +08:00
|
|
|
end
|
|
|
|
|
2013-07-26 03:30:03 +08:00
|
|
|
shared_examples "email block list" do
|
|
|
|
it "doesn't add email to block list by default" do
|
2013-08-14 23:05:53 +08:00
|
|
|
ScreenedEmail.expects(:block).never
|
2013-07-26 03:30:03 +08:00
|
|
|
destroy
|
|
|
|
end
|
|
|
|
|
2017-08-01 06:27:29 +08:00
|
|
|
it "adds emails to block list if block_email is true" do
|
2017-07-25 23:44:46 +08:00
|
|
|
expect {
|
|
|
|
UserDestroyer.new(@admin).destroy(@user, destroy_opts.merge(block_email: true))
|
2017-08-01 06:27:29 +08:00
|
|
|
}.to change { ScreenedEmail.count }.by(2)
|
2013-07-26 03:30:03 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-02-14 00:42:35 +08:00
|
|
|
context 'user deletes self' do
|
2018-06-18 13:57:51 +08:00
|
|
|
let(:destroy_opts) { { delete_posts: true, context: "/u/username/preferences/account" } }
|
2014-02-14 00:42:35 +08:00
|
|
|
subject(:destroy) { UserDestroyer.new(@user).destroy(@user, destroy_opts) }
|
|
|
|
|
|
|
|
include_examples "successfully destroy a user"
|
2018-06-18 13:57:51 +08:00
|
|
|
|
|
|
|
it 'should log proper context' do
|
|
|
|
destroy
|
|
|
|
expect(UserHistory.where(action: UserHistory.actions[:delete_user]).last.context).to eq(I18n.t("staff_action_logs.user_delete_self", url: "/u/username/preferences/account"))
|
|
|
|
end
|
2014-02-14 00:42:35 +08:00
|
|
|
end
|
|
|
|
|
2019-01-04 01:03:01 +08:00
|
|
|
context "with a reviewable post" do
|
|
|
|
let!(:reviewable) { Fabricate(:reviewable, created_by: user) }
|
2015-04-25 04:04:44 +08:00
|
|
|
|
|
|
|
it "removes the queued post" do
|
|
|
|
UserDestroyer.new(admin).destroy(user)
|
2019-01-04 01:03:01 +08:00
|
|
|
expect(Reviewable.where(created_by_id: user.id).count).to eq(0)
|
2015-04-25 04:04:44 +08:00
|
|
|
end
|
2017-01-17 00:46:05 +08:00
|
|
|
end
|
|
|
|
|
2019-09-05 01:12:48 +08:00
|
|
|
context "with a reviewable user" do
|
|
|
|
let(:reviewable) { Fabricate(:reviewable, created_by: admin) }
|
|
|
|
|
|
|
|
it 'sets the reviewable user as rejected' do
|
|
|
|
UserDestroyer.new(admin).destroy(reviewable.target)
|
|
|
|
|
|
|
|
expect(reviewable.reload.status).to eq(Reviewable.statuses[:rejected])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-01-17 00:46:05 +08:00
|
|
|
context "with a directory item record" do
|
2015-04-25 04:04:44 +08:00
|
|
|
|
2017-01-17 00:46:05 +08:00
|
|
|
it "removes the directory item" do
|
|
|
|
DirectoryItem.create!(
|
|
|
|
user: user,
|
|
|
|
period_type: 1,
|
|
|
|
likes_received: 0,
|
|
|
|
likes_given: 0,
|
|
|
|
topics_entered: 0,
|
|
|
|
topic_count: 0,
|
|
|
|
post_count: 0
|
|
|
|
)
|
|
|
|
UserDestroyer.new(admin).destroy(user)
|
|
|
|
expect(DirectoryItem.where(user_id: user.id).count).to eq(0)
|
|
|
|
end
|
2015-04-25 04:04:44 +08:00
|
|
|
end
|
|
|
|
|
2015-08-24 14:05:08 +08:00
|
|
|
context "with a draft" do
|
2019-10-31 14:15:41 +08:00
|
|
|
let!(:draft) { Draft.set(user, 'test', 0, 'test') }
|
2015-08-24 14:05:08 +08:00
|
|
|
|
|
|
|
it "removed the draft" do
|
|
|
|
UserDestroyer.new(admin).destroy(user)
|
|
|
|
expect(Draft.where(user_id: user.id).count).to eq(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-07-25 01:48:55 +08:00
|
|
|
context 'user has posts' do
|
2013-09-05 03:35:10 +08:00
|
|
|
let!(:topic_starter) { Fabricate(:user) }
|
|
|
|
let!(:topic) { Fabricate(:topic, user: topic_starter) }
|
|
|
|
let!(:first_post) { Fabricate(:post, user: topic_starter, topic: topic) }
|
|
|
|
let!(:post) { Fabricate(:post, user: @user, topic: topic) }
|
2013-04-12 04:04:20 +08:00
|
|
|
|
2013-07-25 01:48:55 +08:00
|
|
|
context "delete_posts is false" do
|
|
|
|
subject(:destroy) { UserDestroyer.new(@admin).destroy(@user) }
|
2014-07-29 01:17:37 +08:00
|
|
|
before do
|
|
|
|
@user.stubs(:post_count).returns(1)
|
|
|
|
@user.stubs(:first_post_created_at).returns(Time.zone.now)
|
|
|
|
end
|
2013-07-25 01:48:55 +08:00
|
|
|
|
2018-03-28 16:20:08 +08:00
|
|
|
it 'should raise the right error' do
|
2013-07-25 01:48:55 +08:00
|
|
|
StaffActionLogger.any_instance.expects(:log_user_deletion).never
|
2018-03-28 16:20:08 +08:00
|
|
|
expect { destroy }.to raise_error(UserDestroyer::PostsExistError)
|
|
|
|
expect(user.reload.id).to be_present
|
2013-04-16 02:52:07 +08:00
|
|
|
end
|
2013-07-25 01:48:55 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
context "delete_posts is true" do
|
2017-07-28 09:20:09 +08:00
|
|
|
let(:destroy_opts) { { delete_posts: true } }
|
2013-07-25 01:48:55 +08:00
|
|
|
|
2014-02-14 00:42:35 +08:00
|
|
|
context "staff deletes user" do
|
|
|
|
subject(:destroy) { UserDestroyer.new(@admin).destroy(@user, destroy_opts) }
|
|
|
|
|
|
|
|
include_examples "successfully destroy a user"
|
|
|
|
include_examples "email block list"
|
|
|
|
|
|
|
|
it "deletes the posts" do
|
|
|
|
destroy
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(post.reload.deleted_at).not_to eq(nil)
|
|
|
|
expect(post.user_id).to eq(nil)
|
2014-02-14 00:42:35 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "does not delete topics started by others in which the user has replies" do
|
|
|
|
destroy
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(topic.reload.deleted_at).to eq(nil)
|
|
|
|
expect(topic.user_id).not_to eq(nil)
|
2014-02-14 00:42:35 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "deletes topics started by the deleted user" do
|
|
|
|
spammer_topic = Fabricate(:topic, user: @user)
|
2017-01-17 00:46:05 +08:00
|
|
|
Fabricate(:post, user: @user, topic: spammer_topic)
|
2014-02-14 00:42:35 +08:00
|
|
|
destroy
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(spammer_topic.reload.deleted_at).not_to eq(nil)
|
|
|
|
expect(spammer_topic.user_id).to eq(nil)
|
2014-02-14 00:42:35 +08:00
|
|
|
end
|
2014-10-20 22:59:06 +08:00
|
|
|
|
|
|
|
context "delete_as_spammer is true" do
|
|
|
|
|
|
|
|
before { destroy_opts[:delete_as_spammer] = true }
|
|
|
|
|
2019-01-04 01:03:01 +08:00
|
|
|
it "approves reviewable flags" do
|
2014-10-20 22:59:06 +08:00
|
|
|
spammer_post = Fabricate(:post, user: @user)
|
2019-01-04 01:03:01 +08:00
|
|
|
reviewable = PostActionCreator.inappropriate(@admin, spammer_post).reviewable
|
|
|
|
expect(reviewable).to be_pending
|
2014-10-20 22:59:06 +08:00
|
|
|
|
|
|
|
destroy
|
|
|
|
|
2019-01-04 01:03:01 +08:00
|
|
|
reviewable.reload
|
|
|
|
expect(reviewable).to be_approved
|
2014-10-20 22:59:06 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2013-04-29 23:38:43 +08:00
|
|
|
end
|
2013-09-05 03:35:10 +08:00
|
|
|
|
2014-02-14 00:42:35 +08:00
|
|
|
context "users deletes self" do
|
|
|
|
subject(:destroy) { UserDestroyer.new(@user).destroy(@user, destroy_opts) }
|
|
|
|
|
|
|
|
include_examples "successfully destroy a user"
|
|
|
|
include_examples "email block list"
|
2013-09-05 03:35:10 +08:00
|
|
|
|
2014-02-14 00:42:35 +08:00
|
|
|
it "deletes the posts" do
|
|
|
|
destroy
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(post.reload.deleted_at).not_to eq(nil)
|
|
|
|
expect(post.user_id).to eq(nil)
|
2014-02-14 00:42:35 +08:00
|
|
|
end
|
2013-09-05 03:35:10 +08:00
|
|
|
end
|
2013-07-25 01:48:55 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-08-19 00:07:21 +08:00
|
|
|
context 'user has no posts, but user_stats table has post_count > 0' do
|
|
|
|
before do
|
|
|
|
# out of sync user_stat data shouldn't break UserDestroyer
|
|
|
|
@user.user_stat.update_attribute(:post_count, 1)
|
|
|
|
end
|
2017-10-03 23:28:41 +08:00
|
|
|
let(:destroy_opts) { {} }
|
2017-07-28 09:20:09 +08:00
|
|
|
subject(:destroy) { UserDestroyer.new(@user).destroy(@user, delete_posts: false) }
|
2014-08-19 00:07:21 +08:00
|
|
|
|
|
|
|
include_examples "successfully destroy a user"
|
|
|
|
end
|
|
|
|
|
2013-09-04 05:19:29 +08:00
|
|
|
context 'user has deleted posts' do
|
|
|
|
let!(:deleted_post) { Fabricate(:post, user: @user, deleted_at: 1.hour.ago) }
|
|
|
|
it "should mark the user's deleted posts as belonging to a nuked user" do
|
|
|
|
expect { UserDestroyer.new(@admin).destroy(@user) }.to change { User.count }.by(-1)
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(deleted_post.reload.user_id).to eq(nil)
|
2013-09-04 05:19:29 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-07-25 01:48:55 +08:00
|
|
|
context 'user has no posts' do
|
|
|
|
context 'and destroy succeeds' do
|
2013-07-26 03:30:03 +08:00
|
|
|
let(:destroy_opts) { {} }
|
2013-07-25 01:48:55 +08:00
|
|
|
subject(:destroy) { UserDestroyer.new(@admin).destroy(@user) }
|
|
|
|
|
|
|
|
include_examples "successfully destroy a user"
|
2013-07-26 03:30:03 +08:00
|
|
|
include_examples "email block list"
|
2013-04-12 04:04:20 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'and destroy fails' do
|
2013-07-25 01:48:55 +08:00
|
|
|
subject(:destroy) { UserDestroyer.new(@admin).destroy(@user) }
|
|
|
|
|
2013-04-12 04:04:20 +08:00
|
|
|
it 'should not log the action' do
|
2017-07-25 23:44:46 +08:00
|
|
|
@user.stubs(:destroy).returns(false)
|
2013-07-24 05:58:26 +08:00
|
|
|
StaffActionLogger.any_instance.expects(:log_user_deletion).never
|
2013-04-12 04:04:20 +08:00
|
|
|
destroy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2013-08-14 23:05:53 +08:00
|
|
|
|
|
|
|
context 'user has posts with links' do
|
|
|
|
context 'external links' do
|
|
|
|
before do
|
|
|
|
@post = Fabricate(:post_with_external_links, user: @user)
|
|
|
|
TopicLink.extract_from(@post)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "doesn't add ScreenedUrl records by default" do
|
|
|
|
ScreenedUrl.expects(:watch).never
|
2017-01-06 10:01:14 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(@user, delete_posts: true)
|
2013-08-14 23:05:53 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "adds ScreenedUrl records when :block_urls is true" do
|
2013-08-23 07:04:17 +08:00
|
|
|
ScreenedUrl.expects(:watch).with(anything, anything, has_key(:ip_address)).at_least_once
|
2017-01-06 10:01:14 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(@user, delete_posts: true, block_urls: true)
|
2013-08-14 23:05:53 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'internal links' do
|
|
|
|
before do
|
|
|
|
@post = Fabricate(:post_with_external_links, user: @user)
|
|
|
|
TopicLink.extract_from(@post)
|
|
|
|
TopicLink.any_instance.stubs(:internal).returns(true)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "doesn't add ScreenedUrl records" do
|
|
|
|
ScreenedUrl.expects(:watch).never
|
2017-07-28 09:20:09 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(@user, delete_posts: true, block_urls: true)
|
2013-08-14 23:05:53 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with oneboxed links' do
|
|
|
|
before do
|
|
|
|
@post = Fabricate(:post_with_youtube, user: @user)
|
|
|
|
TopicLink.extract_from(@post)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "doesn't add ScreenedUrl records" do
|
|
|
|
ScreenedUrl.expects(:watch).never
|
2017-07-28 09:20:09 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(@user, delete_posts: true, block_urls: true)
|
2013-08-14 23:05:53 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2013-10-22 02:49:51 +08:00
|
|
|
|
|
|
|
context 'ip address screening' do
|
|
|
|
it "doesn't create screened_ip_address records by default" do
|
|
|
|
ScreenedIpAddress.expects(:watch).never
|
|
|
|
UserDestroyer.new(@admin).destroy(@user)
|
|
|
|
end
|
|
|
|
|
2014-04-30 02:37:56 +08:00
|
|
|
context "block_ip is true" do
|
|
|
|
it "creates a new screened_ip_address record" do
|
|
|
|
ScreenedIpAddress.expects(:watch).with(@user.ip_address).returns(stub_everything)
|
2017-07-28 09:20:09 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(@user, block_ip: true)
|
2014-04-30 02:37:56 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "creates two new screened_ip_address records when registration_ip_address is different than last ip_address" do
|
|
|
|
@user.registration_ip_address = '12.12.12.12'
|
|
|
|
ScreenedIpAddress.expects(:watch).with(@user.ip_address).returns(stub_everything)
|
|
|
|
ScreenedIpAddress.expects(:watch).with(@user.registration_ip_address).returns(stub_everything)
|
2017-07-28 09:20:09 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(@user, block_ip: true)
|
2014-04-30 02:37:56 +08:00
|
|
|
end
|
2013-10-22 02:49:51 +08:00
|
|
|
end
|
|
|
|
end
|
2013-11-02 04:55:56 +08:00
|
|
|
|
|
|
|
context 'user created a category' do
|
2019-08-06 18:26:54 +08:00
|
|
|
let!(:category) { Fabricate(:category_with_definition, user: @user) }
|
2013-11-02 04:55:56 +08:00
|
|
|
|
|
|
|
it "assigns the system user to the categories" do
|
2017-07-28 09:20:09 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(@user, delete_posts: true)
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(category.reload.user_id).to eq(Discourse.system_user.id)
|
|
|
|
expect(category.topic).to be_present
|
|
|
|
expect(category.topic.user_id).to eq(Discourse.system_user.id)
|
2013-11-02 04:55:56 +08:00
|
|
|
end
|
|
|
|
end
|
2014-04-01 02:06:25 +08:00
|
|
|
|
2014-11-29 03:20:43 +08:00
|
|
|
context 'user got an email' do
|
|
|
|
let!(:email_log) { Fabricate(:email_log, user: user) }
|
|
|
|
|
|
|
|
it "deletes the email log" do
|
|
|
|
expect {
|
2017-07-28 09:20:09 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(user, delete_posts: true)
|
2014-11-29 03:20:43 +08:00
|
|
|
}.to change { EmailLog.count }.by(-1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-04-01 02:06:25 +08:00
|
|
|
context 'user liked things' do
|
|
|
|
before do
|
|
|
|
@topic = Fabricate(:topic, user: Fabricate(:user))
|
|
|
|
@post = Fabricate(:post, user: @topic.user, topic: @topic)
|
2019-01-04 01:03:01 +08:00
|
|
|
PostActionCreator.like(@user, @post)
|
2014-04-01 02:06:25 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should destroy the like' do
|
|
|
|
expect {
|
2017-07-28 09:20:09 +08:00
|
|
|
UserDestroyer.new(@admin).destroy(@user, delete_posts: true)
|
2014-04-01 02:06:25 +08:00
|
|
|
}.to change { PostAction.count }.by(-1)
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(@post.reload.like_count).to eq(0)
|
2014-04-01 02:06:25 +08:00
|
|
|
end
|
|
|
|
end
|
2018-03-15 03:11:35 +08:00
|
|
|
|
|
|
|
context 'user belongs to groups that grant trust level' do
|
|
|
|
let(:group) { Fabricate(:group, grant_trust_level: 2) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
group.add(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'can delete the user' do
|
|
|
|
d = UserDestroyer.new(admin)
|
|
|
|
expect {
|
|
|
|
d.destroy(user)
|
|
|
|
}.to change { User.count }.by(-1)
|
|
|
|
end
|
|
|
|
end
|
2018-10-03 01:46:43 +08:00
|
|
|
|
|
|
|
context 'user has staff action logs' do
|
|
|
|
before do
|
|
|
|
logger = StaffActionLogger.new(user)
|
|
|
|
logger.log_site_setting_change(
|
|
|
|
'site_description',
|
|
|
|
'Our friendly community',
|
|
|
|
'My favourite community'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should keep the staff action log and add the username" do
|
|
|
|
username = user.username
|
|
|
|
log = UserHistory.staff_action_records(
|
|
|
|
Discourse.system_user,
|
|
|
|
acting_user: username
|
|
|
|
).to_a[0]
|
|
|
|
UserDestroyer.new(admin).destroy(user, delete_posts: true)
|
|
|
|
log.reload
|
|
|
|
expect(log.details).to include(username)
|
|
|
|
end
|
|
|
|
end
|
2013-04-12 04:04:20 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|