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:
authorJarka Kadlecova <jarka@gitlab.com>2017-05-26 13:50:52 +0300
committerJarka Kadlecova <jarka@gitlab.com>2017-06-01 08:47:15 +0300
commitb71025c014babf9663e0451ad21eabde91570259 (patch)
tree743041e1fe0480c44671c95a0f470c62c9ed9d60 /app/controllers/projects/services_controller.rb
parent44f2504a811b107a35403d9c0a8b8fce66f502c8 (diff)
Add feature tests for improved JIRA settings
Diffstat (limited to 'app/controllers/projects/services_controller.rb')
-rw-r--r--app/controllers/projects/services_controller.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb
index 89c4e81a36f..264665942f8 100644
--- a/app/controllers/projects/services_controller.rb
+++ b/app/controllers/projects/services_controller.rb
@@ -22,17 +22,22 @@ class Projects::ServicesController < Projects::ApplicationController
end
def test
- return render json: {}, status: :not_found unless @service.can_test?
+ message = {}
- data = @service.test_data(project, current_user)
- outcome = @service.test(data)
+ if @service.can_test?
+ data = @service.test_data(project, current_user)
+ outcome = @service.test(data)
- message = {}
- unless outcome[:success]
- message = { error: true, message: 'Test failed', service_response: outcome[:result].to_s }
+ unless outcome[:success]
+ message = { error: true, message: 'Test failed.', service_response: outcome[:result].to_s }
+ end
+
+ status = :ok
+ else
+ status = :not_found
end
- render json: message, status: :ok
+ render json: message, status: status
end
private