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:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2016-10-28 18:35:46 +0300
committerAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2016-10-28 18:35:46 +0300
commitceaafd3a6e253f6af827b9c9ede37150c3ed3b95 (patch)
tree390ab7cb34fa4ffeb5f3ebe9fba38a433ebb4044 /spec/views
parent3f979481a1592d274e3b032ce74070f30645a184 (diff)
Add commit_box spec
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..eaf5a0ee1bd
--- /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
+ first_pipeline = create(:ci_pipeline, project: project, sha: project.commit.id, status: 'success')
+ second_pipeline = 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