FIX: user destroyer spec (#11567)
Don't user @user and @admin after https://github.com/discourse/discourse/commit/db235c5ff92
This commit is contained in:
parent
32ff52dd42
commit
edf4e8b788
|
@ -213,13 +213,13 @@ describe UserDestroyer do
|
|||
end
|
||||
|
||||
context 'user created category' do
|
||||
let!(:topic) { Fabricate(:topic, user: @user) }
|
||||
let!(:first_post) { Fabricate(:post, user: @user, topic: topic) }
|
||||
let!(:second_post) { Fabricate(:post, user: @user, topic: topic) }
|
||||
let!(:category) { Fabricate(:category, user: @user, topic_id: topic.id) }
|
||||
let!(:topic) { Fabricate(:topic, user: user) }
|
||||
let!(:first_post) { Fabricate(:post, user: user, topic: topic) }
|
||||
let!(:second_post) { Fabricate(:post, user: user, topic: topic) }
|
||||
let!(:category) { Fabricate(:category, user: user, topic_id: topic.id) }
|
||||
|
||||
it 'changes author of first category post to system user and still deletes second post' do
|
||||
UserDestroyer.new(@admin).destroy(@user, delete_posts: true)
|
||||
UserDestroyer.new(admin).destroy(user, delete_posts: true)
|
||||
|
||||
expect(first_post.reload.deleted_at).to eq(nil)
|
||||
expect(first_post.user_id).to eq(Discourse.system_user.id)
|
||||
|
|
Loading…
Reference in New Issue