debian-mirror-gitlab/spec/views/projects/settings/operations/show.html.haml_spec.rb

89 lines
2.6 KiB
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe 'projects/settings/operations/show' do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
2021-01-03 14:25:43 +05:30
let_it_be(:error_tracking_setting) do
create(:project_error_tracking_setting, project: project)
end
let_it_be_with_reload(:tracing_setting) do
create(:project_tracing_setting, project: project)
end
2021-09-30 23:02:18 +05:30
let_it_be(:prometheus_integration) { create(:prometheus_integration, project: project) }
2019-02-15 15:39:39 +05:30
2021-01-03 14:25:43 +05:30
before_all do
2021-01-29 00:20:46 +05:30
project.add_maintainer(user)
2021-01-03 14:25:43 +05:30
end
2019-02-15 15:39:39 +05:30
before do
assign :project, project
2021-01-03 14:25:43 +05:30
allow(view).to receive(:error_tracking_setting)
.and_return(error_tracking_setting)
allow(view).to receive(:tracing_setting)
.and_return(tracing_setting)
2021-09-30 23:02:18 +05:30
allow(view).to receive(:prometheus_integration)
.and_return(prometheus_integration)
2021-01-03 14:25:43 +05:30
allow(view).to receive(:current_user).and_return(user)
2019-02-15 15:39:39 +05:30
end
2021-03-08 18:12:59 +05:30
describe 'Operations > Alerts' do
it 'renders the Operations Settings page' do
render
2021-09-04 01:27:46 +05:30
expect(rendered).to have_content _('Alerts')
2021-04-29 21:17:54 +05:30
expect(rendered).to have_content _('Display alerts from all configured monitoring tools.')
2021-03-08 18:12:59 +05:30
end
end
2019-02-15 15:39:39 +05:30
describe 'Operations > Error Tracking' do
2021-01-03 14:25:43 +05:30
context 'Settings page ' do
it 'renders the Operations Settings page' do
2021-03-08 18:12:59 +05:30
render
2019-02-15 15:39:39 +05:30
2021-01-03 14:25:43 +05:30
expect(rendered).to have_content _('Error tracking')
2021-06-08 01:23:25 +05:30
expect(rendered).to have_content _('Link Sentry to GitLab to discover and view the errors your application generates.')
2021-01-03 14:25:43 +05:30
end
2019-02-15 15:39:39 +05:30
end
2021-01-03 14:25:43 +05:30
end
2019-02-15 15:39:39 +05:30
2021-03-08 18:12:59 +05:30
describe 'Operations > Prometheus' do
context 'when settings_operations_prometheus_service flag is enabled' do
it 'renders the Operations Settings page' do
render
expect(rendered).to have_content _('Prometheus')
expect(rendered).to have_content _('Link Prometheus monitoring to GitLab.')
2021-09-04 01:27:46 +05:30
expect(rendered).to have_content _('To use a Prometheus installed on a cluster, deactivate the manual configuration.')
2021-03-08 18:12:59 +05:30
end
end
context 'when settings_operations_prometheus_service is disabled' do
before do
stub_feature_flags(settings_operations_prometheus_service: false)
end
it 'renders the Operations Settings page' do
render
2021-04-17 20:07:23 +05:30
expect(rendered).not_to have_content _('Auto configuration settings are used unless you override their values here.')
2021-03-08 18:12:59 +05:30
end
end
end
2021-01-03 14:25:43 +05:30
describe 'Operations > Tracing' do
2021-09-04 01:27:46 +05:30
context 'Settings page ' do
it 'renders the Tracing Settings page' do
2021-03-08 18:12:59 +05:30
render
2019-02-15 15:39:39 +05:30
2021-09-04 01:27:46 +05:30
expect(rendered).to have_content _('Embed an image of your existing Jaeger server in GitLab.')
2019-02-15 15:39:39 +05:30
end
end
end
end