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

28 lines
541 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
2018-07-05 02:32:05 -04:00
describe 'RavenJS' do
2018-05-03 16:24:18 -04:00
let(:raven_path) { '/raven.chunk.js' }
it 'does not load raven if sentry is disabled' do
visit new_user_session_path
expect(has_requested_raven).to eq(false)
end
it 'loads raven if sentry is enabled' do
stub_sentry_settings
visit new_user_session_path
expect(has_requested_raven).to eq(true)
end
def has_requested_raven
2017-10-29 09:04:49 -04:00
page.all('script', visible: false).one? do |elm|
elm[:src] =~ /#{raven_path}$/
end
end
end