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
|
|
|
|
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
|
|
|
|
|
2021-12-10 13:14:42 -05:00
|
|
|
context 'when showing a CI build' do
|
2016-06-28 08:05:32 -04:00
|
|
|
before do
|
2021-12-10 13:14:42 -05:00
|
|
|
assign(:build, build.present)
|
2016-06-28 08:05:32 -04:00
|
|
|
render
|
|
|
|
end
|
|
|
|
|
2021-12-10 13:14:42 -05:00
|
|
|
it 'shows job vue app' do
|
|
|
|
expect(rendered).to have_css('#js-job-page')
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when job is running' do
|
|
|
|
let(:build) { create(:ci_build, :trace_live, :running, pipeline: pipeline) }
|
|
|
|
|
|
|
|
it 'does not show retry button' do
|
|
|
|
expect(rendered).not_to have_link('Retry')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not show New issue button' do
|
|
|
|
expect(rendered).not_to have_link('New issue')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2016-06-28 08:05:32 -04:00
|
|
|
end
|