Commit 6ae47476 authored by Rémy Coutable's avatar Rémy Coutable

Replace ci_status_path with pipeline_path

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent acc60818
...@@ -6,11 +6,6 @@ ...@@ -6,11 +6,6 @@
# See 'detailed_status?` method and `Gitlab::Ci::Status` module. # See 'detailed_status?` method and `Gitlab::Ci::Status` module.
# #
module CiStatusHelper module CiStatusHelper
def ci_status_path(pipeline)
project = pipeline.project
project_pipeline_path(project, pipeline)
end
def ci_label_for_status(status) def ci_label_for_status(status)
if detailed_status?(status) if detailed_status?(status)
return status.label return status.label
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
%td.build-link %td.build-link
- if project - if project
= link_to ci_status_path(build.pipeline) do = link_to pipeline_path(build.pipeline) do
%strong= build.pipeline.short_sha %strong= build.pipeline.short_sha
%td.timestamp %td.timestamp
......
require 'spec_helper' require 'spec_helper'
describe 'Commits' do describe 'Commits' do
include CiStatusHelper
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -33,7 +31,7 @@ describe 'Commits' do ...@@ -33,7 +31,7 @@ describe 'Commits' do
describe 'Commit builds' do describe 'Commit builds' do
before do before do
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
end end
it { expect(page).to have_content pipeline.sha[0..7] } it { expect(page).to have_content pipeline.sha[0..7] }
...@@ -79,7 +77,7 @@ describe 'Commits' do ...@@ -79,7 +77,7 @@ describe 'Commits' do
describe 'Commit builds', :js do describe 'Commit builds', :js do
before do before do
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
end end
it 'shows pipeline`s data' do it 'shows pipeline`s data' do
...@@ -95,7 +93,7 @@ describe 'Commits' do ...@@ -95,7 +93,7 @@ describe 'Commits' do
end end
it do it do
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
click_on 'Download artifacts' click_on 'Download artifacts'
expect(page.response_headers['Content-Type']).to eq(artifacts_file.content_type) expect(page.response_headers['Content-Type']).to eq(artifacts_file.content_type)
end end
...@@ -103,7 +101,7 @@ describe 'Commits' do ...@@ -103,7 +101,7 @@ describe 'Commits' do
describe 'Cancel all builds' do describe 'Cancel all builds' do
it 'cancels commit', :js do it 'cancels commit', :js do
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
click_on 'Cancel running' click_on 'Cancel running'
expect(page).to have_content 'canceled' expect(page).to have_content 'canceled'
end end
...@@ -111,7 +109,7 @@ describe 'Commits' do ...@@ -111,7 +109,7 @@ describe 'Commits' do
describe 'Cancel build' do describe 'Cancel build' do
it 'cancels build', :js do it 'cancels build', :js do
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
find('.js-btn-cancel-pipeline').click find('.js-btn-cancel-pipeline').click
expect(page).to have_content 'canceled' expect(page).to have_content 'canceled'
end end
...@@ -120,13 +118,13 @@ describe 'Commits' do ...@@ -120,13 +118,13 @@ describe 'Commits' do
describe '.gitlab-ci.yml not found warning' do describe '.gitlab-ci.yml not found warning' do
context 'ci builds enabled' do context 'ci builds enabled' do
it "does not show warning" do it "does not show warning" do
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
expect(page).not_to have_content '.gitlab-ci.yml not found in this commit' expect(page).not_to have_content '.gitlab-ci.yml not found in this commit'
end end
it 'shows warning' do it 'shows warning' do
stub_ci_pipeline_yaml_file(nil) stub_ci_pipeline_yaml_file(nil)
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
expect(page).to have_content '.gitlab-ci.yml not found in this commit' expect(page).to have_content '.gitlab-ci.yml not found in this commit'
end end
end end
...@@ -135,7 +133,7 @@ describe 'Commits' do ...@@ -135,7 +133,7 @@ describe 'Commits' do
before do before do
stub_ci_builds_disabled stub_ci_builds_disabled
stub_ci_pipeline_yaml_file(nil) stub_ci_pipeline_yaml_file(nil)
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
end end
it 'does not show warning' do it 'does not show warning' do
...@@ -149,7 +147,7 @@ describe 'Commits' do ...@@ -149,7 +147,7 @@ describe 'Commits' do
before do before do
project.team << [user, :reporter] project.team << [user, :reporter]
build.update_attributes(artifacts_file: artifacts_file) build.update_attributes(artifacts_file: artifacts_file)
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
end end
it 'Renders header', :js do it 'Renders header', :js do
...@@ -171,7 +169,7 @@ describe 'Commits' do ...@@ -171,7 +169,7 @@ describe 'Commits' do
visibility_level: Gitlab::VisibilityLevel::INTERNAL, visibility_level: Gitlab::VisibilityLevel::INTERNAL,
public_builds: false) public_builds: false)
build.update_attributes(artifacts_file: artifacts_file) build.update_attributes(artifacts_file: artifacts_file)
visit ci_status_path(pipeline) visit pipeline_path(pipeline)
end end
it do it do
......
...@@ -202,7 +202,6 @@ export default { ...@@ -202,7 +202,6 @@ export default {
"revert_in_fork_path": "/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+cherry-pick+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1", "revert_in_fork_path": "/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+cherry-pick+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1",
"email_patches_path": "/root/acets-app/merge_requests/22.patch", "email_patches_path": "/root/acets-app/merge_requests/22.patch",
"plain_diff_path": "/root/acets-app/merge_requests/22.diff", "plain_diff_path": "/root/acets-app/merge_requests/22.diff",
"ci_status_path": "/root/acets-app/merge_requests/22/ci_status",
"status_path": "/root/acets-app/merge_requests/22.json", "status_path": "/root/acets-app/merge_requests/22.json",
"merge_check_path": "/root/acets-app/merge_requests/22/merge_check", "merge_check_path": "/root/acets-app/merge_requests/22/merge_check",
"ci_environments_status_url": "/root/acets-app/merge_requests/22/ci_environments_status", "ci_environments_status_url": "/root/acets-app/merge_requests/22/ci_environments_status",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment