blob: 7516a636c93de5fffa2faed2f4a1c97770825f23 (
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# frozen_string_literal: true
require 'spec_helper'
describe Projects::ErrorTrackingHelper do
include Gitlab::Routing.url_helpers
set(:project) { create(:project) }
describe '#error_tracking_data' do
let(:setting_path) { project_settings_operations_path(project) }
let(:index_path) do
project_error_tracking_index_path(project, format: :json)
end
context 'without error_tracking_setting' do
it 'returns frontend configuration' do
expect(error_tracking_data(project)).to eq(
'index-path' => index_path,
'enable-error-tracking-link' => setting_path,
'error-tracking-enabled' => 'false',
"illustration-path" => "/images/illustrations/cluster_popover.svg"
)
end
end
context 'with error_tracking_setting' do
let(:error_tracking_setting) do
create(:project_error_tracking_setting, project: project)
end
context 'when enabled' do
before do
error_tracking_setting.update!(enabled: true)
end
it 'show error tracking enabled' do
expect(error_tracking_data(project)).to include(
'error-tracking-enabled' => 'true'
)
end
end
context 'when disabled' do
before do
error_tracking_setting.update!(enabled: false)
end
it 'show error tracking not enabled' do
expect(error_tracking_data(project)).to include(
'error-tracking-enabled' => 'false'
)
end
end
end
end
end
|