diff options
author | Grzegorz Bizon <grzegorz.bizon@ntsn.pl> | 2015-12-14 13:28:49 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz.bizon@ntsn.pl> | 2015-12-14 13:28:49 +0300 |
commit | b8f67c5e4735eb25a3d03daeb95900dc87692123 (patch) | |
tree | ef00cb4394ca45563636fd49b5a9378f117e9d49 /spec/features/commits_spec.rb | |
parent | 2dafec91dd542ac641fea4750bf8fd68211a58af (diff) |
Do not display ci build status if builds enabled but no `.gitlab-ci.yml`
Ref #3827
Diffstat (limited to 'spec/features/commits_spec.rb')
-rw-r--r-- | spec/features/commits_spec.rb | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb index 80ff4d3751f..f48d96c35a4 100644 --- a/spec/features/commits_spec.rb +++ b/spec/features/commits_spec.rb @@ -19,7 +19,36 @@ describe 'Commits' do let!(:build) { FactoryGirl.create :ci_build, commit: commit } - describe 'GET /:project/commits/:sha/ci' do + describe 'Project commits' do + context 'builds enabled' do + context '.gitlab-ci.yml found' do + before do + visit namespace_project_commits_path(project.namespace, project, :master) + end + + it 'should show build status' do + page.within("//li[@id='commit-#{commit.short_sha}']") do + expect(page).to have_css(".ci-status-link") + end + end + end + + context 'no .gitlab-ci.yml found' do + before do + stub_ci_commit_yaml_file(nil) + visit namespace_project_commits_path(project.namespace, project, :master) + end + + it 'should not show build status' do + page.within("//li[@id='commit-#{commit.short_sha}']") do + expect(page).to have_no_css(".ci-status-link") + end + end + end + end + end + + describe 'Commit builds' do before do visit ci_status_path(commit) end |