diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-06 00:07:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-06 00:07:46 +0300 |
commit | 82cef8dd1f48ffbc7aaa1ff7374cdb859137e01e (patch) | |
tree | 0ebdac2f1880dd1dd3f73a956082759314e0994f /spec/features/sentry_js_spec.rb | |
parent | 2baa63e740214382387abe77eeea6c0b1759e621 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/sentry_js_spec.rb')
-rw-r--r-- | spec/features/sentry_js_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/features/sentry_js_spec.rb b/spec/features/sentry_js_spec.rb new file mode 100644 index 00000000000..b39c4f0a0ae --- /dev/null +++ b/spec/features/sentry_js_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Sentry' do + let(:sentry_path) { '/sentry.chunk.js' } + + it 'does not load sentry if sentry is disabled' do + allow(Gitlab.config.sentry).to receive(:enabled).and_return(false) + visit new_user_session_path + + expect(has_requested_sentry).to eq(false) + end + + it 'loads sentry if sentry is enabled' do + stub_sentry_settings + + visit new_user_session_path + + expect(has_requested_sentry).to eq(true) + end + + def has_requested_sentry + page.all('script', visible: false).one? do |elm| + elm[:src] =~ /#{sentry_path}$/ + end + end +end |