Fix running manual action tooltip

This commit is contained in:
Grzegorz Bizon 2018-01-16 12:22:09 +01:00
parent 7951acfd15
commit c0e9a46dd5
2 changed files with 8 additions and 5 deletions

View File

@ -2,6 +2,9 @@ module Gitlab
module Ci
module Status
module Build
##
# Extended status for playable manual actions.
#
class Action < Status::Extended
def label
if has_action?
@ -12,7 +15,7 @@ module Gitlab
end
def self.matches?(build, user)
build.action?
build.playable?
end
end
end

View File

@ -37,16 +37,16 @@ describe Gitlab::Ci::Status::Build::Action do
describe '.matches?' do
subject { described_class.matches?(build, user) }
context 'when build is an action' do
let(:build) { create(:ci_build, :manual) }
context 'when build is playable action' do
let(:build) { create(:ci_build, :playable) }
it 'is a correct match' do
expect(subject).to be true
end
end
context 'when build is not manual' do
let(:build) { create(:ci_build) }
context 'when build is not playable action' do
let(:build) { create(:ci_build, :non_playable) }
it 'does not match' do
expect(subject).to be false