2019-10-08 08:06:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-28 08:05:32 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 11:08:50 -04:00
|
|
|
RSpec.describe 'projects/jobs/show' do
|
2018-04-05 17:04:42 -04:00
|
|
|
let(:user) { create(:user) }
|
2017-03-27 16:20:27 -04:00
|
|
|
let(:project) { create(:project, :repository) }
|
2016-11-09 13:40:25 -05:00
|
|
|
let(:build) { create(:ci_build, pipeline: pipeline) }
|
2018-04-05 17:04:42 -04:00
|
|
|
let(:builds) { project.builds.present(current_user: user) }
|
2016-11-09 13:40:25 -05:00
|
|
|
|
2016-07-18 04:40:33 -04:00
|
|
|
let(:pipeline) do
|
2016-11-09 13:40:25 -05:00
|
|
|
create(:ci_pipeline, project: project, sha: project.commit.id)
|
2016-07-18 04:40:33 -04:00
|
|
|
end
|
2016-06-28 08:05:32 -04:00
|
|
|
|
|
|
|
before do
|
2017-04-06 02:45:01 -04:00
|
|
|
assign(:build, build.present)
|
2016-06-28 08:05:32 -04:00
|
|
|
assign(:project, project)
|
2018-04-05 17:04:42 -04:00
|
|
|
assign(:builds, builds)
|
2016-06-28 08:05:32 -04:00
|
|
|
|
|
|
|
allow(view).to receive(:can?).and_return(true)
|
|
|
|
end
|
|
|
|
|
2017-01-26 06:52:58 -05:00
|
|
|
context 'when job is running' do
|
2018-04-03 13:47:04 -04:00
|
|
|
let(:build) { create(:ci_build, :trace_live, :running, pipeline: pipeline) }
|
|
|
|
|
2016-06-28 08:05:32 -04:00
|
|
|
before do
|
|
|
|
render
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not show retry button' do
|
|
|
|
expect(rendered).not_to have_link('Retry')
|
|
|
|
end
|
2017-02-22 18:42:14 -05:00
|
|
|
|
|
|
|
it 'does not show New issue button' do
|
|
|
|
expect(rendered).not_to have_link('New issue')
|
|
|
|
end
|
2016-06-28 08:05:32 -04:00
|
|
|
end
|
|
|
|
end
|