Commit 7380ed30 authored by Tristan Read's avatar Tristan Read Committed by Peter Leitzen

Add view and feature test for error tracking settings

parent 0c1d6be1
......@@ -549,6 +549,7 @@ module ProjectsHelper
services#edit
repository#show
ci_cd#show
operations#show
badges#index
pages#show
]
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Projects > Settings > For a forked project', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:role) { :maintainer }
before do
stub_feature_flags(error_tracking: true)
sign_in(user)
project.add_role(user, role)
end
describe 'Sidebar > Operations' do
context 'when sidebar feature flag enabled' do
it 'renders the settings link in the sidebar' do
visit project_path(project)
wait_for_requests
expect(page).to have_selector('a[title="Operations"]', visible: false)
end
end
context 'when sidebar feature flag disabled' do
before do
stub_feature_flags(error_tracking: false)
end
it 'does not render the settings link in the sidebar' do
visit project_path(project)
wait_for_requests
expect(page).not_to have_selector('a[title="Operations"]', visible: false)
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
require 'rails_helper'
describe 'projects/settings/operations/show' do
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
assign :project, project
end
describe 'Operations > Error Tracking' do
before do
stub_feature_flags(error_tracking: true)
project.add_reporter(user)
allow(view).to receive(:error_tracking_setting)
.and_return(error_tracking_setting)
allow(view).to receive(:current_user).and_return(user)
end
let!(:error_tracking_setting) do
create(:project_error_tracking_setting, project: project)
end
context 'Settings page ' do
it 'renders the Operations Settings page' do
render
expect(rendered).to have_content _('Error Tracking')
expect(rendered).to have_content _('To link Sentry to GitLab, enter your Sentry URL and Auth Token')
expect(rendered).to have_content _('Active')
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment