summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-03-31 21:29:51 -0700
committerStan Hu <stanhu@gmail.com>2017-04-02 05:37:05 -0700
commit6a2d022d1d578f8957736de2fb895069c24c072b (patch)
tree206166bcce0e3256b7d8151e5b9172fc01ae4e5a /spec/requests
parent8a71d40e60c799f969af0ed255e931b6c9907634 (diff)
downloadgitlab-ce-6a2d022d1d578f8957736de2fb895069c24c072b.tar.gz
Delete users asynchronouslysh-fix-destroy-user-race
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/users_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 04e7837fd7a..f793c0db2f3 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -676,7 +676,7 @@ describe API::Users, api: true do
before { admin }
it "deletes user" do
- delete api("/users/#{user.id}", admin)
+ Sidekiq::Testing.inline! { delete api("/users/#{user.id}", admin) }
expect(response).to have_http_status(204)
expect { User.find(user.id) }.to raise_error ActiveRecord::RecordNotFound
@@ -684,23 +684,23 @@ describe API::Users, api: true do
end
it "does not delete for unauthenticated user" do
- delete api("/users/#{user.id}")
+ Sidekiq::Testing.inline! { delete api("/users/#{user.id}") }
expect(response).to have_http_status(401)
end
it "is not available for non admin users" do
- delete api("/users/#{user.id}", user)
+ Sidekiq::Testing.inline! { delete api("/users/#{user.id}", user) }
expect(response).to have_http_status(403)
end
it "returns 404 for non-existing user" do
- delete api("/users/999999", admin)
+ Sidekiq::Testing.inline! { delete api("/users/999999", admin) }
expect(response).to have_http_status(404)
expect(json_response['message']).to eq('404 User Not Found')
end
it "returns a 404 for invalid ID" do
- delete api("/users/ASDF", admin)
+ Sidekiq::Testing.inline! { delete api("/users/ASDF", admin) }
expect(response).to have_http_status(404)
end