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:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-01-06 15:21:49 +0300
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-01-06 15:21:49 +0300
commitdf99883d4487e4a511a2b930c53c9d993bde8704 (patch)
treedc95e10a9faf9902c5a7bc113edfac545d0a1d3b /spec/controllers/admin
parentb46ad4c90b779102af8545a0d9a0789a9fc4c085 (diff)
Add tests for admin service templates
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r--spec/controllers/admin/services_controller_spec.rb26
1 files changed, 26 insertions, 0 deletions
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