GitLab steht aufgrund wichtiger Wartungsarbeiten am Montag, den 8. März, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

raven_js_spec.rb 685 Bytes
Newer Older
1 2
require 'spec_helper'

3 4
feature 'RavenJS', :feature, :js do
  let(:raven_path) { '/raven.bundle.js' }
5 6 7 8 9 10 11 12

  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
13 14
    allow_any_instance_of(SentryHelper).to receive_messages(sentry_dsn_public: 'https://key@domain.com/id',
                                                            sentry_enabled?: true)
15 16 17 18 19 20 21 22 23 24

    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