debian-mirror-gitlab/spec/views/projects/jobs/show.html.haml_spec.rb

39 lines
914 B
Ruby
Raw Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
2016-08-24 12:49:21 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe 'projects/jobs/show' do
2018-05-09 12:01:36 +05:30
let(:user) { create(:user) }
2017-08-17 22:00:37 +05:30
let(:project) { create(:project, :repository) }
let(:build) { create(:ci_build, pipeline: pipeline) }
2018-05-09 12:01:36 +05:30
let(:builds) { project.builds.present(current_user: user) }
2016-08-24 12:49:21 +05:30
let(:pipeline) do
2017-08-17 22:00:37 +05:30
create(:ci_pipeline, project: project, sha: project.commit.id)
2016-08-24 12:49:21 +05:30
end
before do
2017-08-17 22:00:37 +05:30
assign(:build, build.present)
2016-08-24 12:49:21 +05:30
assign(:project, project)
2018-05-09 12:01:36 +05:30
assign(:builds, builds)
2016-08-24 12:49:21 +05:30
allow(view).to receive(:can?).and_return(true)
end
2017-08-17 22:00:37 +05:30
context 'when job is running' do
2018-05-09 12:01:36 +05:30
let(:build) { create(:ci_build, :trace_live, :running, pipeline: pipeline) }
2016-08-24 12:49:21 +05:30
before do
render
end
it 'does not show retry button' do
expect(rendered).not_to have_link('Retry')
end
2017-08-17 22:00:37 +05:30
it 'does not show New issue button' do
expect(rendered).not_to have_link('New issue')
end
2016-08-24 12:49:21 +05:30
end
end