From 10f5cfe3c2d266701fc6df062a631eb0e6cda708 Mon Sep 17 00:00:00 2001
From: rpereira2 <rpereira@gitlab.com>
Date: Wed, 9 Jan 2019 00:46:14 +0530
Subject: [PATCH] Fix failing operations/update_service_spec

- Fix specs failing due to new validation.
- Also remove a method definition that was repeated.
---
 lib/sentry/client.rb                                     | 9 ---------
 spec/services/projects/operations/update_service_spec.rb | 8 ++++----
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/lib/sentry/client.rb b/lib/sentry/client.rb
index b3a29a5e423..9a93f3c3f6f 100644
--- a/lib/sentry/client.rb
+++ b/lib/sentry/client.rb
@@ -27,15 +27,6 @@ module Sentry
       }
     end
 
-    def request_params
-      {
-        headers: {
-          'Authorization' => "Bearer #{@token}"
-        },
-        follow_redirects: false
-      }
-    end
-
     def get_issues(issue_status:, limit:)
       resp = Gitlab::HTTP.get(
         issues_api_url,
diff --git a/spec/services/projects/operations/update_service_spec.rb b/spec/services/projects/operations/update_service_spec.rb
index 731be907453..6afae3da80c 100644
--- a/spec/services/projects/operations/update_service_spec.rb
+++ b/spec/services/projects/operations/update_service_spec.rb
@@ -17,7 +17,7 @@ describe Projects::Operations::UpdateService do
           {
             error_tracking_setting_attributes: {
               enabled: false,
-              api_url: 'http://url',
+              api_url: 'http://gitlab.com/api/0/projects/org/project',
               token: 'token'
             }
           }
@@ -32,7 +32,7 @@ describe Projects::Operations::UpdateService do
 
           project.reload
           expect(project.error_tracking_setting).not_to be_enabled
-          expect(project.error_tracking_setting.api_url).to eq('http://url')
+          expect(project.error_tracking_setting.api_url).to eq('http://gitlab.com/api/0/projects/org/project')
           expect(project.error_tracking_setting.token).to eq('token')
         end
       end
@@ -42,7 +42,7 @@ describe Projects::Operations::UpdateService do
           {
             error_tracking_setting_attributes: {
               enabled: true,
-              api_url: 'http://url',
+              api_url: 'http://gitlab.com/api/0/projects/org/project',
               token: 'token'
             }
           }
@@ -52,7 +52,7 @@ describe Projects::Operations::UpdateService do
           expect(result[:status]).to eq(:success)
 
           expect(project.error_tracking_setting).to be_enabled
-          expect(project.error_tracking_setting.api_url).to eq('http://url')
+          expect(project.error_tracking_setting.api_url).to eq('http://gitlab.com/api/0/projects/org/project')
           expect(project.error_tracking_setting.token).to eq('token')
         end
       end
-- 
2.30.9