diff options
Diffstat (limited to 'spec/controllers/chaos_controller_spec.rb')
-rw-r--r-- | spec/controllers/chaos_controller_spec.rb | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/controllers/chaos_controller_spec.rb b/spec/controllers/chaos_controller_spec.rb index cb4f12ff829..26ae4a6b693 100644 --- a/spec/controllers/chaos_controller_spec.rb +++ b/spec/controllers/chaos_controller_spec.rb @@ -109,7 +109,7 @@ RSpec.describe ChaosController do describe '#kill' do it 'calls synchronously' do - expect(Gitlab::Chaos).to receive(:kill).with(no_args) + expect(Gitlab::Chaos).to receive(:kill).with('KILL') get :kill @@ -117,7 +117,7 @@ RSpec.describe ChaosController do end it 'calls asynchronously' do - expect(Chaos::KillWorker).to receive(:perform_async).with(no_args) + expect(Chaos::KillWorker).to receive(:perform_async).with('KILL') get :kill, params: { async: 1 } @@ -125,6 +125,24 @@ RSpec.describe ChaosController do end end + describe '#quit' do + it 'calls synchronously' do + expect(Gitlab::Chaos).to receive(:kill).with('QUIT') + + get :quit + + expect(response).to have_gitlab_http_status(:ok) + end + + it 'calls asynchronously' do + expect(Chaos::KillWorker).to receive(:perform_async).with('QUIT') + + get :quit, params: { async: 1 } + + expect(response).to have_gitlab_http_status(:ok) + end + end + describe '#gc' do let(:gc_stat) { GC.stat.stringify_keys } |