diff options
author | Stan Hu <stanhu@gmail.com> | 2017-03-31 21:29:51 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-04-02 05:37:05 -0700 |
commit | 6a2d022d1d578f8957736de2fb895069c24c072b (patch) | |
tree | 206166bcce0e3256b7d8151e5b9172fc01ae4e5a /spec/controllers/registrations_controller_spec.rb | |
parent | 8a71d40e60c799f969af0ed255e931b6c9907634 (diff) | |
download | gitlab-ce-6a2d022d1d578f8957736de2fb895069c24c072b.tar.gz |
Delete users asynchronouslysh-fix-destroy-user-race
Diffstat (limited to 'spec/controllers/registrations_controller_spec.rb')
-rw-r--r-- | spec/controllers/registrations_controller_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 902911071c4..71dd9ef3eb4 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -68,4 +68,20 @@ describe RegistrationsController do end end end + + describe '#destroy' do + let(:user) { create(:user) } + + before do + sign_in(user) + end + + it 'schedules the user for destruction' do + expect(DeleteUserWorker).to receive(:perform_async).with(user.id, user.id) + + post(:destroy) + + expect(response.status).to eq(302) + end + end end |