diff options
Diffstat (limited to 'spec/features/projects/pipelines/pipeline_spec.rb')
-rw-r--r-- | spec/features/projects/pipelines/pipeline_spec.rb | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 5a53e48f5f8..cfac54ef259 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -254,4 +254,57 @@ describe 'Pipeline', :feature, :js do it { expect(build_manual.reload).to be_pending } end end + + describe 'GET /:project/pipelines/:id/failures' do + let(:project) { create(:project) } + let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) } + let(:pipeline_failures_page) { failures_namespace_project_pipeline_path(project.namespace, project, pipeline) } + let!(:failed_build) { create(:ci_build, :failed, pipeline: pipeline) } + + context 'with failed build' do + before do + failed_build.trace.set('4 examples, 1 failure') + + visit pipeline_failures_page + end + + it 'shows jobs tab pane as active' do + expect(page).to have_content('Failed Jobs') + expect(page).to have_css('#js-tab-failures.active') + end + + it 'lists failed builds' do + expect(page).to have_content(failed_build.name) + expect(page).to have_content(failed_build.stage) + end + + it 'shows build failure logs' do + expect(page).to have_content('4 examples, 1 failure') + end + end + + context 'when missing build logs' do + before do + visit pipeline_failures_page + end + + it 'includes failed jobs' do + expect(page).to have_content('No job trace') + end + end + + context 'without failures' do + before do + failed_build.update!(status: :success) + + visit pipeline_failures_page + end + + it 'displays the pipeline graph' do + expect(current_path).to eq(pipeline_path(pipeline)) + expect(page).not_to have_content('Failed Jobs') + expect(page).to have_selector('.pipeline-visualization') + end + end + end end |