2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
RSpec.describe 'project commit pipelines', :js, feature_category: :continuous_integration do
|
2018-11-08 19:23:39 +05:30
|
|
|
let(:project) { create(:project, :repository) }
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
before do
|
2020-07-28 23:09:34 +05:30
|
|
|
create(:ci_pipeline, project: project,
|
|
|
|
sha: project.commit.sha,
|
|
|
|
ref: 'master')
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
user = create(:user)
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
visit pipelines_project_commit_path(project, project.commit.sha)
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
context 'when no builds triggered yet' do
|
2020-07-28 23:09:34 +05:30
|
|
|
it 'shows the ID of the first pipeline' do
|
2021-01-03 14:25:43 +05:30
|
|
|
page.within('.pipelines .ci-table') do
|
2020-07-28 23:09:34 +05:30
|
|
|
expect(page).to have_content project.ci_pipelines[0].id # pipeline ids
|
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
2020-07-28 23:09:34 +05:30
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
context 'with no related merge requests' do
|
|
|
|
it 'shows the correct text for no related MRs' do
|
|
|
|
wait_for_requests
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
page.within('.merge-request-info') do
|
2021-06-08 01:23:25 +05:30
|
|
|
expect(page).not_to have_selector '.gl-spinner'
|
2020-07-28 23:09:34 +05:30
|
|
|
expect(page).to have_content 'No related merge requests found'
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|