gitlab-org--gitlab-foss/spec/features/raven_js_spec.rb

26 lines
607 B
Ruby
Raw Normal View History

require 'spec_helper'
2018-07-05 06:32:05 +00:00
describe 'RavenJS' do
2018-05-03 20:24:18 +00:00
let(:raven_path) { '/raven.chunk.js' }
it 'should not load raven if sentry is disabled' do
visit new_user_session_path
expect(has_requested_raven).to eq(false)
end
it 'should load raven if sentry is enabled' do
2017-04-28 15:01:22 +00:00
stub_application_setting(clientside_sentry_dsn: 'https://key@domain.com/id', clientside_sentry_enabled: true)
visit new_user_session_path
expect(has_requested_raven).to eq(true)
end
def has_requested_raven
2017-10-29 13:04:49 +00:00
page.all('script', visible: false).one? do |elm|
elm[:src] =~ /#{raven_path}$/
end
end
end