summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-14 11:28:49 +0100
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-14 11:28:49 +0100
commitb8f67c5e4735eb25a3d03daeb95900dc87692123 (patch)
treeef00cb4394ca45563636fd49b5a9378f117e9d49 /spec
parent2dafec91dd542ac641fea4750bf8fd68211a58af (diff)
downloadgitlab-ce-b8f67c5e4735eb25a3d03daeb95900dc87692123.tar.gz
Do not display ci build status if builds enabled but no `.gitlab-ci.yml`
Ref #3827
Diffstat (limited to 'spec')
-rw-r--r--spec/features/commits_spec.rb31
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