diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-06 12:16:40 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-04-06 12:16:40 +0300 |
commit | 2bf8345542dbdae17c3755ca7157cbaf70ffde41 (patch) | |
tree | 48b9b82e6ae9ed2e12649b4ea4f95b6833948d3a /spec/features/projects/jobs | |
parent | 99edc15127d9d23475c94079d53e2893f58c042a (diff) | |
parent | 20e9b32c96a5b08e3f61c8974b43977f98d8666e (diff) |
Merge branch 'master' into '42568-pipeline-empty-state'
# Conflicts:
# app/views/projects/jobs/show.html.haml
# lib/gitlab/ci/status/core.rb
Diffstat (limited to 'spec/features/projects/jobs')
-rw-r--r-- | spec/features/projects/jobs/user_browses_job_spec.rb | 22 | ||||
-rw-r--r-- | spec/features/projects/jobs/user_browses_jobs_spec.rb | 11 |
2 files changed, 33 insertions, 0 deletions
diff --git a/spec/features/projects/jobs/user_browses_job_spec.rb b/spec/features/projects/jobs/user_browses_job_spec.rb index a728e6eb996..3c8b28e8408 100644 --- a/spec/features/projects/jobs/user_browses_job_spec.rb +++ b/spec/features/projects/jobs/user_browses_job_spec.rb @@ -35,4 +35,26 @@ describe 'User browses a job', :js do expect(build.project.running_or_pending_build_count).to eq(build.project.builds.running_or_pending.count(:all)) end + + context 'with a failed job' do + let!(:build) { create(:ci_build, :failed, pipeline: pipeline) } + + it 'displays the failure reason' do + within('.builds-container') do + build_link = first('.build-job > a') + expect(build_link['data-title']).to eq('test - failed <br> (unknown failure)') + end + end + end + + context 'when a failed job has been retried' do + let!(:build) { create(:ci_build, :failed, :retried, pipeline: pipeline) } + + it 'displays the failure reason and retried label' do + within('.builds-container') do + build_link = first('.build-job > a') + expect(build_link['data-title']).to eq('test - failed <br> (unknown failure) (retried)') + end + end + end end diff --git a/spec/features/projects/jobs/user_browses_jobs_spec.rb b/spec/features/projects/jobs/user_browses_jobs_spec.rb index 767777f3bf9..36ebbeadd4a 100644 --- a/spec/features/projects/jobs/user_browses_jobs_spec.rb +++ b/spec/features/projects/jobs/user_browses_jobs_spec.rb @@ -29,4 +29,15 @@ describe 'User browses jobs' do expect(ci_lint_tool_link[:href]).to end_with(ci_lint_path) end end + + context 'with a failed job' do + let!(:build) { create(:ci_build, :coverage, :failed, pipeline: pipeline) } + + it 'displays a tooltip with the failure reason' do + page.within('.ci-table') do + failed_job_link = page.find('.ci-failed') + expect(failed_job_link[:title]).to eq('Failed <br> (unknown failure)') + end + end + end end |