debian-mirror-gitlab/spec/features/projects/jobs/user_browses_jobs_spec.rb

39 lines
1.1 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'User browses jobs' do
2018-03-17 18:26:18 +05:30
let!(:build) { create(:ci_build, :coverage, pipeline: pipeline) }
let(:pipeline) { create(:ci_empty_pipeline, project: project, sha: project.commit.sha, ref: 'master') }
let(:project) { create(:project, :repository, namespace: user.namespace) }
let(:user) { create(:user) }
before do
2021-04-29 21:17:54 +05:30
stub_feature_flags(jobs_table_vue: false)
2018-11-18 11:00:15 +05:30
project.add_maintainer(user)
2018-03-17 18:26:18 +05:30
project.enable_ci
project.update_attribute(:build_coverage_regex, /Coverage (\d+)%/)
sign_in(user)
visit(project_jobs_path(project))
end
it 'shows the coverage' do
page.within('td.coverage') do
expect(page).to have_content('99.9%')
end
end
2018-05-09 12:01:36 +05:30
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')
2018-11-08 19:23:39 +05:30
expect(failed_job_link[:title]).to eq('Failed - (unknown failure)')
2018-05-09 12:01:36 +05:30
end
end
end
2018-03-17 18:26:18 +05:30
end