Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-11-01 00:29:29 +0300
committerFatih Acet <acetfatih@gmail.com>2016-11-01 00:29:29 +0300
commit68dadc98ae94f9c20bd5f80c8eeb78d46cc45d53 (patch)
treee5482793f15829f6433d3f87bcdcd83b05b697f3 /spec/views
parent4707e341826ce67a725d270f8ac03e2e28c4924c (diff)
parent73f697d53bdec63e65bb95c328d69afef7c86e45 (diff)
Merge branch '20892-commit-info' into 'master'
Resolve "Clean up commit meta info view" Updates commit page design Before: ![Screen_Shot_2016-10-19_at_10.20.10_AM](/uploads/8737a9db01bffc019d8b2c71a943024b/Screen_Shot_2016-10-19_at_10.20.10_AM.png) After: ![Screen_Shot_2016-10-19_at_10.20.01_AM](/uploads/716cb902bd20dedc705a8f81f6536736/Screen_Shot_2016-10-19_at_10.20.01_AM.png) ![Screen_Shot_2016-10-19_at_10.27.01_AM](/uploads/4228575f50990a88bc828037d8fb99f2/Screen_Shot_2016-10-19_at_10.27.01_AM.png) Closes #20892 See merge request !6994
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/projects/commit/_commit_box.html.haml_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/views/projects/commit/_commit_box.html.haml_spec.rb b/spec/views/projects/commit/_commit_box.html.haml_spec.rb
new file mode 100644
index 00000000000..16bf0698c4b
--- /dev/null
+++ b/spec/views/projects/commit/_commit_box.html.haml_spec.rb
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+describe 'projects/commit/_commit_box.html.haml' do
+ include Devise::Test::ControllerHelpers
+
+ let(:project) { create(:project) }
+
+ before do
+ assign(:project, project)
+ assign(:commit, project.commit)
+ end
+
+ it 'shows the commit SHA' do
+ render
+
+ expect(rendered).to have_text("Commit #{Commit.truncate_sha(project.commit.sha)}")
+ end
+
+ it 'shows the last pipeline that ran for the commit' do
+ create(:ci_pipeline, project: project, sha: project.commit.id, status: 'success')
+ create(:ci_pipeline, project: project, sha: project.commit.id, status: 'canceled')
+ third_pipeline = create(:ci_pipeline, project: project, sha: project.commit.id, status: 'failed')
+
+ render
+
+ expect(rendered).to have_text("Pipeline ##{third_pipeline.id} for #{Commit.truncate_sha(project.commit.sha)} failed")
+ end
+end