Commit ceb2a768 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'fix/gb/improve-manual-action-tooltips' into 'master'

Fix running manual action tooltip

Closes #41418

See merge request gitlab-org/gitlab-ce!16489
parents 73cb6c3e 6cdc711b
---
title: Fix tooltip displayed for running manual actions
merge_request: 16489
author:
type: fixed
...@@ -2,6 +2,9 @@ module Gitlab ...@@ -2,6 +2,9 @@ module Gitlab
module Ci module Ci
module Status module Status
module Build module Build
##
# Extended status for playable manual actions.
#
class Action < Status::Extended class Action < Status::Extended
def label def label
if has_action? if has_action?
...@@ -12,7 +15,7 @@ module Gitlab ...@@ -12,7 +15,7 @@ module Gitlab
end end
def self.matches?(build, user) def self.matches?(build, user)
build.action? build.playable?
end end
end end
end end
......
...@@ -37,16 +37,16 @@ describe Gitlab::Ci::Status::Build::Action do ...@@ -37,16 +37,16 @@ describe Gitlab::Ci::Status::Build::Action do
describe '.matches?' do describe '.matches?' do
subject { described_class.matches?(build, user) } subject { described_class.matches?(build, user) }
context 'when build is an action' do context 'when build is playable action' do
let(:build) { create(:ci_build, :manual) } let(:build) { create(:ci_build, :playable) }
it 'is a correct match' do it 'is a correct match' do
expect(subject).to be true expect(subject).to be true
end end
end end
context 'when build is not manual' do context 'when build is not playable action' do
let(:build) { create(:ci_build) } let(:build) { create(:ci_build, :non_playable) }
it 'does not match' do it 'does not match' do
expect(subject).to be false expect(subject).to be false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment