2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
describe 'RavenJS' do
|
2018-10-15 14:42:47 +05:30
|
|
|
let(:raven_path) { '/raven.chunk.js' }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
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
|
|
|
|
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
|
2018-03-17 18:26:18 +05:30
|
|
|
page.all('script', visible: false).one? do |elm|
|
|
|
|
elm[:src] =~ /#{raven_path}$/
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|