summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-04-25 17:23:55 +0000
committerRobert Speicher <robert@gitlab.com>2016-04-25 17:23:55 +0000
commitf89fea54e4c24bf1273fe1e2b7296fdd611eecd2 (patch)
treee6e62556ee1cac49cde2130010791edbb10012c6
parentb79c5c40e18086f10b849d069bc1c496a851cbae (diff)
parentb822f65a52405a9736dd760af8d87a11299a98ff (diff)
downloadgitlab-ce-f89fea54e4c24bf1273fe1e2b7296fdd611eecd2.tar.gz
Merge branch 'fix/error-on-builds-page' into 'master'
Fix error on commit builds page This MR fixes error on commit builds page that occurs before CI commit (Pipeline) had been updated. Closes #15509 See merge request !3874
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/projects/commit/_ci_commit.html.haml2
-rw-r--r--spec/features/projects/commit/builds_spec.rb27
3 files changed, 29 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index fbc3ee194cb..533e8ecfebc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.8.0 (unreleased)
- Remove future dates from contribution calendar graph.
+ - Fix error when visiting commit builds page before build was updated
v 8.7.1 (unreleased)
- Fix .gitlab-ci.yml parsing issue when hidde job is a template without script definition. !3849
diff --git a/app/views/projects/commit/_ci_commit.html.haml b/app/views/projects/commit/_ci_commit.html.haml
index 25714e6cb47..d3acd33116c 100644
--- a/app/views/projects/commit/_ci_commit.html.haml
+++ b/app/views/projects/commit/_ci_commit.html.haml
@@ -16,7 +16,7 @@
- if defined?(link_to_commit) && link_to_commit
for commit
= link_to ci_commit.short_sha, namespace_project_commit_path(@project.namespace, @project, ci_commit.sha), class: "monospace"
- - if ci_commit.duration > 0
+ - if ci_commit.duration
in
= time_interval_in_words ci_commit.duration
diff --git a/spec/features/projects/commit/builds_spec.rb b/spec/features/projects/commit/builds_spec.rb
new file mode 100644
index 00000000000..40ba0bdc115
--- /dev/null
+++ b/spec/features/projects/commit/builds_spec.rb
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+feature 'project commit builds' do
+ given(:project) { create(:project) }
+
+ background do
+ user = create(:user)
+ project.team << [user, :master]
+ login_as(user)
+ end
+
+ context 'when no builds triggered yet' do
+ background do
+ create(:ci_commit, project: project,
+ sha: project.commit.sha,
+ ref: 'master')
+ end
+
+ scenario 'user views commit builds page' do
+ visit builds_namespace_project_commit_path(project.namespace,
+ project, project.commit.sha)
+
+
+ expect(page).to have_content('Builds')
+ end
+ end
+end