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
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
......
......@@ -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
......
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