Commit 30f375cf authored by Kamil Trzcinski's avatar Kamil Trzcinski

Don't show other actions of the same name

parent f3d03af4
......@@ -97,7 +97,7 @@ module Ci
end
def other_actions
pipeline.manual_actions.where.not(id: self)
pipeline.manual_actions.where.not(name: name)
end
def playable?
......
......@@ -808,6 +808,22 @@ describe Ci::Build, models: true do
it 'returns other actions' do
is_expected.to contain_exactly(other_build)
end
context 'when build is retried' do
let!(:new_build) { Ci::Build.retry(build) }
it 'does not return any of them' do
is_expected.not_to include(build, new_build)
end
end
context 'when other build is retried' do
let!(:retried_build) { Ci::Build.retry(other_build) }
it 'returns a retried build' do
is_expected.to contain_exactly(retried_build)
end
end
end
describe '#play' do
......
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