Allows to cancel a Created job

This commit is contained in:
Jacopo 2018-08-10 13:59:38 +02:00
parent d867a58c2b
commit c6301865b9
3 changed files with 12 additions and 1 deletions

View File

@ -226,7 +226,7 @@ module Ci
end
def cancelable?
active?
active? || created?
end
def retryable?

View File

@ -0,0 +1,5 @@
---
title: Allows to cancel a Created job
merge_request: 20635
author: Jacopo Beschi @jacopo-beschi
type: added

View File

@ -1103,6 +1103,12 @@ describe Ci::Build do
it { is_expected.to be_cancelable }
end
context 'when build is created' do
let(:build) { create(:ci_build, :created) }
it { is_expected.to be_cancelable }
end
end
context 'when build is not cancelable' do