summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/projects/error_tracking_controller.rb10
-rw-r--r--spec/controllers/projects/error_tracking_controller_spec.rb2
2 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/error_tracking_controller.rb b/app/controllers/projects/error_tracking_controller.rb
index 2cd3dad12a2..88d0755f41f 100644
--- a/app/controllers/projects/error_tracking_controller.rb
+++ b/app/controllers/projects/error_tracking_controller.rb
@@ -48,7 +48,11 @@ class Projects::ErrorTrackingController < Projects::ApplicationController
)
result = service.execute
- unless result[:status] == :success
+ if result[:status] == :success
+ render json: {
+ projects: serialize_projects(result[:projects])
+ }
+ else
return render(
status: result[:http_status] || :bad_request,
json: {
@@ -56,10 +60,6 @@ class Projects::ErrorTrackingController < Projects::ApplicationController
}
)
end
-
- render json: {
- projects: serialize_projects(result[:projects])
- }
end
def list_projects_params
diff --git a/spec/controllers/projects/error_tracking_controller_spec.rb b/spec/controllers/projects/error_tracking_controller_spec.rb
index db23e3d917b..844c61f1ace 100644
--- a/spec/controllers/projects/error_tracking_controller_spec.rb
+++ b/spec/controllers/projects/error_tracking_controller_spec.rb
@@ -161,7 +161,7 @@ describe Projects::ErrorTrackingController do
end
before do
- expect(ErrorTracking::ListProjectsService)
+ allow(ErrorTracking::ListProjectsService)
.to receive(:new).with(project, user, permitted_params)
.and_return(list_projects_service)
end