From f014d9d13bc4290cbee39858399a2abeac387863 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Thu, 7 Jul 2022 17:07:05 +0200 Subject: [PATCH] chore: Ability to Disable Sentry Transactions (#4989) fixes: #4866 --- config/initializers/sentry.rb | 2 +- spec/controllers/api/v1/accounts/inboxes_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 1b1c557db..098f9bdb4 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -5,7 +5,7 @@ if ENV['SENTRY_DSN'] # To activate performance monitoring, set one of these options. # We recommend adjusting the value in production: - config.traces_sample_rate = 0.1 + config.traces_sample_rate = 0.1 if ENV['ENABLE_SENTRY_TRANSACTIONS'] config.excluded_exceptions += ['Rack::Timeout::RequestTimeoutException'] diff --git a/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb b/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb index bea71b6dd..3867aa1fc 100644 --- a/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb @@ -49,7 +49,7 @@ RSpec.describe 'Inboxes API', type: :request do get "/api/v1/accounts/#{account.id}/inboxes", headers: admin.create_new_auth_token, as: :json - expect(JSON.parse(response.body)['payload'].last.key?('provider_config')).to eq(true) + expect(response.body).to include('provider_config') end it 'will not return provider config for agent' do @@ -57,7 +57,7 @@ RSpec.describe 'Inboxes API', type: :request do headers: agent.create_new_auth_token, as: :json - expect(JSON.parse(response.body)['payload'].last.key?('provider_config')).to eq(false) + expect(response.body).not_to include('provider_config') end end end