Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-04-01 07:29:51 +0300
committerStan Hu <stanhu@gmail.com>2017-04-02 15:37:05 +0300
commit6a2d022d1d578f8957736de2fb895069c24c072b (patch)
tree206166bcce0e3256b7d8151e5b9172fc01ae4e5a /spec/controllers
parent8a71d40e60c799f969af0ed255e931b6c9907634 (diff)
Delete users asynchronously
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/registrations_controller_spec.rb16
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