diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-05-21 21:11:00 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-05-21 21:11:00 +0900 |
commit | b053c483e792e00c50ba57e461e3a09ebdb8f34d (patch) | |
tree | acc53922ae92edf5e6d18284adb818d0cd60365c /spec | |
parent | 5af5815d62f3430c52bb489c590eaa32402b18fa (diff) | |
download | gitlab-ce-b053c483e792e00c50ba57e461e3a09ebdb8f34d.tar.gz |
Add test for the cancelled jobs
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/runner_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index da392c5ab81..efb9bddde44 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -918,6 +918,22 @@ describe API::Runner, :clean_gitlab_redis_shared_state do expect(job.reload.trace.raw).to eq 'BUILD TRACE appended appended' end + context 'when job is cancelled' do + before do + job.cancel + end + + context 'when trace is patched' do + before do + patch_the_trace + end + + it 'returns Forbidden ' do + expect(response.status).to eq(403) + end + end + end + context 'when redis data are flushed' do before do redis_shared_state_cleanup! |