summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-05 15:55:55 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-05 15:59:03 +0100
commite5a7ed3ac36aaa1045353e589dae98a29ca72f1e (patch)
treecbcc99d6d2bff548f739e9e196b0001fed8dc878
parent12fbce2eacdfbbc9bca7f7eaca6e5679ee1aaffd (diff)
downloadgitlab-ce-add-sentry-js-again-with-vue.tar.gz
-rw-r--r--app/assets/javascripts/raven/index.js2
-rw-r--r--lib/gitlab/gon_helper.rb1
-rw-r--r--spec/javascripts/raven/index_spec.js3
-rw-r--r--spec/javascripts/raven/raven_config_spec.js4
4 files changed, 3 insertions, 7 deletions
diff --git a/app/assets/javascripts/raven/index.js b/app/assets/javascripts/raven/index.js
index 3c5656040b9..5325e495815 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 848b3352c63..26473f99bc3 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 85ec1de4e4e..b5662cd0331 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 2a2b91fe948..a2d720760fc 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);
});