2019-11-05 16:07:46 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'Sentry' do
|
|
|
|
let(:sentry_regex_path) { '\/sentry.*\.chunk\.js' }
|
2019-11-05 16:07:46 -05:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-10-13 02:09:09 -04:00
|
|
|
xit 'loads sentry if sentry is enabled' do
|
2019-11-05 16:07:46 -05:00
|
|
|
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|
|
2020-06-03 14:08:28 -04:00
|
|
|
elm[:src] =~ /#{sentry_regex_path}$/
|
2019-11-05 16:07:46 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|