2016-10-09 22:40:58 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-04-04 13:58:45 +00:00
|
|
|
feature 'RavenJS', :feature, :js do
|
|
|
|
let(:raven_path) { '/raven.bundle.js' }
|
2016-10-09 22:40:58 +00:00
|
|
|
|
|
|
|
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-04 13:58:45 +00:00
|
|
|
allow_any_instance_of(SentryHelper).to receive_messages(sentry_dsn_public: 'https://key@domain.com/id',
|
|
|
|
sentry_enabled?: true)
|
2016-10-09 22:40:58 +00:00
|
|
|
|
|
|
|
visit new_user_session_path
|
|
|
|
|
|
|
|
expect(has_requested_raven).to eq(true)
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_requested_raven
|
|
|
|
page.driver.network_traffic.one? {|request| request.url.end_with?(raven_path)}
|
|
|
|
end
|
|
|
|
end
|