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

44 lines
1.2 KiB
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
require 'spec_helper'
describe 'User browses jobs' do
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
project.add_master(user)
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
it 'shows the "CI Lint" button' do
page.within('.nav-controls') do
ci_lint_tool_link = page.find_link('CI lint')
2018-10-15 14:42:47 +05:30
expect(ci_lint_tool_link[:href]).to end_with(project_ci_lint_path(project))
2018-03-17 18:26:18 +05:30
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')
expect(failed_job_link[:title]).to eq('Failed <br> (unknown failure)')
end
end
end
2018-03-17 18:26:18 +05:30
end