diff options
author | Luke Bennett <lukeeeebennettplus@gmail.com> | 2016-10-10 01:40:58 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-01-23 11:23:57 +0300 |
commit | c252c03401881fd7dbf7fab984285c402eb31d5f (patch) | |
tree | eb7d75b8b6e55c6ce8ea82fb91ba023430b747ce /spec/features | |
parent | 8a6e415268c60074b8cd9508c106120107ce5731 (diff) |
Added raven and raven-vue plugin, updated gon_helper with data needed for raven and created raven_config, required by application.js
Added is_production to define sentry environment
Removed as much jQuery as possible
Added public_sentry_dsn application_settings helper method
Use URI module instead of regex for public dsn
Removed raven-vue and load raven on if sentry is enabled
Add load_script spec
added raven_config spec
added class_spec_helper and tests
added sentry_helper spec
added feature spec
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/raven_js_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/features/raven_js_spec.rb b/spec/features/raven_js_spec.rb new file mode 100644 index 00000000000..e64da1e3a97 --- /dev/null +++ b/spec/features/raven_js_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +feature 'RavenJS', feature: true, js: true do + let(:raven_path) { '/raven.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 + allow_any_instance_of(ApplicationController).to receive_messages(sentry_dsn_public: 'https://mock:sentry@dsn/path', + sentry_enabled?: true) + + 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 |