Welcome to mirror list, hosted at ThFree Co, Russian Federation.

raven_js_spec.rb « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e64da1e3a974f0df5ae5f659c6881cbc845b5f4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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