summaryrefslogtreecommitdiff
path: root/spec/controllers/projects
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-07-19 13:08:47 +0200
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-07-21 10:22:09 +0200
commit2086483b24e719ec8d82b3e7a52476626952885a (patch)
treea7d8fe979a0e2309b7517804e452d7162ccd422b /spec/controllers/projects
parenteaceee0fb9e23982571c9c2a878d662ba241240e (diff)
downloadgitlab-ce-2086483b24e719ec8d82b3e7a52476626952885a.tar.gz
Rename build to pipeline for status badges
First commit in probably 2, for resolve gitlab-org/gitlab-ce#15582. This commit is renaming files and classes from build to pipeline. Also wording is editted to pipeline. Given `pipeline` had more characters than `build`, I've made the field a bit wider. The width now matchers the one for the coverage badge, so they look nice when in a table format, or in a list. As soon as this commit is merged to master, and released, the build.svg is deprecated, meaning that all users which already placed a badge should update it. However, to make sure it keeps working tests are added for this case.
Diffstat (limited to 'spec/controllers/projects')
-rw-r--r--spec/controllers/projects/badges_controller_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/controllers/projects/badges_controller_spec.rb b/spec/controllers/projects/badges_controller_spec.rb
new file mode 100644
index 00000000000..d68200164e4
--- /dev/null
+++ b/spec/controllers/projects/badges_controller_spec.rb
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+describe Projects::BadgesController do
+ let(:project) { pipeline.project }
+ let!(:pipeline) { create(:ci_empty_pipeline) }
+ let(:user) { create(:user) }
+
+ before do
+ project.add_master(user)
+ sign_in(user)
+ end
+
+ it 'requests the pipeline badge successfully' do
+ get_badge(:pipeline)
+
+ expect(response).to have_http_status(:ok)
+ end
+
+ it 'requests the coverage badge successfully' do
+ get_badge(:coverage)
+
+ expect(response).to have_http_status(:ok)
+ end
+
+ def get_badge(badge)
+ get badge, namespace_id: project.namespace.to_param, project_id: project, ref: pipeline.ref, format: :svg
+ end
+end