diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-06-13 10:17:11 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-06-13 15:45:45 +0200 |
commit | 26820d1f5d950a3430737b350b664bfdf7622ba6 (patch) | |
tree | 5930a1b6e93fd1fd835460dc067b7f19df9073ce /spec/models/ci | |
parent | 652eb0118b3cf87f96dfbaacf5802d974303e427 (diff) | |
download | gitlab-ce-26820d1f5d950a3430737b350b664bfdf7622ba6.tar.gz |
Do not show manual actions that cannot be runfix-manual-actions
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/build_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index b0716e04d3d..b06e77c34f6 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -21,6 +21,18 @@ describe Ci::Build, :models do it { is_expected.to respond_to(:has_trace?) } it { is_expected.to respond_to(:trace) } + describe '.manual_actions' do + let!(:manual_but_created) { create(:ci_build, :manual, status: :created, pipeline: pipeline) } + let!(:manual_but_succeeded) { create(:ci_build, :manual, status: :success, pipeline: pipeline) } + let!(:manual_action) { create(:ci_build, :manual, pipeline: pipeline) } + + subject { described_class.manual_actions } + + it { is_expected.to include(manual_action) } + it { is_expected.to include(manual_but_succeeded) } + it { is_expected.not_to include(manual_but_created) } + end + describe '#actionize' do context 'when build is a created' do before do @@ -926,6 +938,10 @@ describe Ci::Build, :models do context 'when other build is retried' do let!(:retried_build) { Ci::Build.retry(other_build, user) } + before do + retried_build.success + end + it 'returns a retried build' do is_expected.to contain_exactly(retried_build) end |