summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-01-06 13:21:49 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-01-06 13:21:49 +0100
commitdf99883d4487e4a511a2b930c53c9d993bde8704 (patch)
treedc95e10a9faf9902c5a7bc113edfac545d0a1d3b
parentb46ad4c90b779102af8545a0d9a0789a9fc4c085 (diff)
downloadgitlab-ce-zj-fix-admin-templates.tar.gz
Add tests for admin service templateszj-fix-admin-templates
-rw-r--r--app/views/projects/services/slack_slash_commands/_help.html.haml2
-rw-r--r--spec/controllers/admin/services_controller_spec.rb26
2 files changed, 27 insertions, 1 deletions
diff --git a/app/views/projects/services/slack_slash_commands/_help.html.haml b/app/views/projects/services/slack_slash_commands/_help.html.haml
index 8aac1b0c7da..04b9100acc6 100644
--- a/app/views/projects/services/slack_slash_commands/_help.html.haml
+++ b/app/views/projects/services/slack_slash_commands/_help.html.haml
@@ -1,4 +1,4 @@
-- pretty_name = defined?(@project) ? @project.path_with_namespace : "namespace / path"
+- pretty_name = defined?(@project) ? @project.name_with_namespace : "namespace / path"
- run_actions_text = "Perform common operations on this project: #{pretty_name}"
.well
diff --git a/spec/controllers/admin/services_controller_spec.rb b/spec/controllers/admin/services_controller_spec.rb
new file mode 100644
index 00000000000..e5cdd52307e
--- /dev/null
+++ b/spec/controllers/admin/services_controller_spec.rb
@@ -0,0 +1,26 @@
+require 'spec_helper'
+
+describe Admin::ServicesController do
+ let(:admin) { create(:admin) }
+
+ before { sign_in(admin) }
+
+ describe 'GET #edit' do
+ let!(:project) { create(:empty_project) }
+
+ Service.available_services_names.each do |service_name|
+ context "#{service_name}" do
+ let!(:service) do
+ service_template = service_name.concat("_service").camelize.constantize
+ service_template.where(template: true).first_or_create
+ end
+
+ it 'successfully displays the template' do
+ get :edit, id: service.id
+
+ expect(response).to have_http_status(200)
+ end
+ end
+ end
+ end
+end