diff --git a/app/assets/javascripts/raven/index.js b/app/assets/javascripts/raven/index.js index 3c5656040b9e10a490330325945b86fcc505c789..5325e495815f705813969797c88305659413ef97 100644 --- a/app/assets/javascripts/raven/index.js +++ b/app/assets/javascripts/raven/index.js @@ -5,7 +5,7 @@ const index = function index() { sentryDsn: gon.sentry_dsn, currentUserId: gon.current_user_id, whitelistUrls: [gon.gitlab_url], - isProduction: gon.is_production, + isProduction: process.env.NODE_ENV, }); return RavenConfig; diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index 848b3352c63b786cccf086023af8736ecfc8f14b..26473f99bc351900f339d6cd5f4c0d7245c3c898 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -12,7 +12,6 @@ module Gitlab gon.katex_js_url = ActionController::Base.helpers.asset_path('katex.js') gon.sentry_dsn = current_application_settings.clientside_sentry_dsn if current_application_settings.clientside_sentry_enabled gon.gitlab_url = Gitlab.config.gitlab.url - gon.is_production = Rails.env.production? if current_user gon.current_user_id = current_user.id diff --git a/spec/javascripts/raven/index_spec.js b/spec/javascripts/raven/index_spec.js index 85ec1de4e4efa325c7fb2541157a69593712463d..b5662cd0331c7a37d93643931435adc8f1dd0c34 100644 --- a/spec/javascripts/raven/index_spec.js +++ b/spec/javascripts/raven/index_spec.js @@ -18,9 +18,10 @@ describe('RavenConfig options', () => { sentry_dsn: sentryDsn, current_user_id: currentUserId, gitlab_url: gitlabUrl, - is_production: isProduction, }; + process.env.NODE_ENV = isProduction; + spyOn(RavenConfig, 'init'); indexReturnValue = index(); diff --git a/spec/javascripts/raven/raven_config_spec.js b/spec/javascripts/raven/raven_config_spec.js index 2a2b91fe9480ce305291f75a2f565a30856cb07d..a2d720760fce6882445e3612b2fdea020e4e380f 100644 --- a/spec/javascripts/raven/raven_config_spec.js +++ b/spec/javascripts/raven/raven_config_spec.js @@ -157,10 +157,6 @@ describe('RavenConfig', () => { RavenConfig.bindRavenErrors(); }); - it('should query for document using jquery', () => { - expect(window.$).toHaveBeenCalledWith(document); - }); - it('should call .on', function () { expect($document.on).toHaveBeenCalledWith('ajaxError.raven', RavenConfig.handleRavenErrors); });