Commit 94cec500 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Do not show build retry link when build is active

parent 2efee5f6
......@@ -40,7 +40,7 @@
.block{ class: ("block-first" if !@build.coverage && !(can?(current_user, :read_build, @project) && (@build.artifacts? || @build.artifacts_expired?))) }
.title
Build details
- if @build.retryable?
- if @build.retryable? && !@build.active?
= link_to "Retry", retry_namespace_project_build_path(@project.namespace, @project, @build), class: 'pull-right', method: :post
- if @build.merge_request
%p.build-detail-row
......
require 'spec_helper'
describe 'projects/builds/show' do
include Devise::TestHelpers
let(:build) { create(:ci_build) }
let(:project) { build.project }
before do
assign(:build, build)
assign(:project, project)
allow(view).to receive(:can?).and_return(true)
end
context 'when build is running' do
before do
build.run!
render
end
it 'does not show retry button' do
expect(rendered).not_to have_link('Retry')
end
end
context 'when build is not running' do
before do
build.success!
render
end
it 'shows retry button' do
expect(rendered).to have_link('Retry')
end
end
end
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