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

37 lines
877 B
Ruby
Raw Normal View History

2016-08-24 12:49:21 +05:30
require 'spec_helper'
2017-09-10 17:25:29 +05:30
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