Commit 01846674 authored by Kamil Trzciński's avatar Kamil Trzciński Committed by Robert Speicher

Merge branch 'fix/commit-status-artifacts' into 'master'

Use generic method to checks if artifacts are available

Closes #12626

See merge request !2576
parent 78860b60
...@@ -10,6 +10,9 @@ v 8.4.2 (unreleased) ...@@ -10,6 +10,9 @@ v 8.4.2 (unreleased)
track them in Performance Monitoring. track them in Performance Monitoring.
- Increase contrast between highlighted code comments and inline diff marker. - Increase contrast between highlighted code comments and inline diff marker.
v 8.4.2 (unreleased)
- Fix method undefined when using external commit status in builds
v 8.4.1 v 8.4.1
- Apply security updates for Rails (4.2.5.1), rails-html-sanitizer (1.0.3), - Apply security updates for Rails (4.2.5.1), rails-html-sanitizer (1.0.3),
and Nokogiri (1.6.7.2) and Nokogiri (1.6.7.2)
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
%td %td
.pull-right .pull-right
- if current_user && can?(current_user, :read_build_artifacts, commit_status.project) && commit_status.artifacts? - if current_user && can?(current_user, :read_build_artifacts, commit_status.project) && commit_status.artifacts_download_url
= link_to commit_status.artifacts_download_url, title: 'Download artifacts' do = link_to commit_status.artifacts_download_url, title: 'Download artifacts' do
%i.fa.fa-download %i.fa.fa-download
- if current_user && can?(current_user, :manage_builds, commit_status.project) - if current_user && can?(current_user, :manage_builds, commit_status.project)
......
FactoryGirl.define do FactoryGirl.define do
factory :commit_status, class: CommitStatus do factory :commit_status, class: CommitStatus do
started_at 'Di 29. Okt 09:51:28 CET 2013'
finished_at 'Di 29. Okt 09:53:28 CET 2013'
name 'default' name 'default'
status 'success' status 'success'
description 'commit status' description 'commit status'
commit factory: :ci_commit_with_one_job commit factory: :ci_commit_with_one_job
started_at 'Tue, 26 Jan 2016 08:21:42 +0100'
finished_at 'Tue, 26 Jan 2016 08:23:42 +0100'
after(:build) do |build, evaluator|
build.project = build.commit.project
end
factory :generic_commit_status, class: GenericCommitStatus do factory :generic_commit_status, class: GenericCommitStatus do
name 'generic' name 'generic'
......
...@@ -16,6 +16,26 @@ describe 'Commits' do ...@@ -16,6 +16,26 @@ describe 'Commits' do
FactoryGirl.create :ci_commit, project: project, sha: project.commit.sha FactoryGirl.create :ci_commit, project: project, sha: project.commit.sha
end end
context 'commit status is Generic Commit Status' do
let!(:status) { FactoryGirl.create :generic_commit_status, commit: commit }
describe 'Commit builds' do
before do
visit ci_status_path(commit)
end
it { expect(page).to have_content commit.sha[0..7] }
it 'contains generic commit status build' do
page.within('.table-holder') do
expect(page).to have_content "##{status.id}" # build id
expect(page).to have_content 'generic' # build name
end
end
end
end
context 'commit status is Ci Build' do
let!(:build) { FactoryGirl.create :ci_build, commit: commit } let!(:build) { FactoryGirl.create :ci_build, commit: commit }
describe 'Project commits' do describe 'Project commits' do
...@@ -97,4 +117,5 @@ describe 'Commits' do ...@@ -97,4 +117,5 @@ describe 'Commits' do
end end
end end
end end
end
end end
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