Commit 6bb6a5b2 authored by Peter Leitzen's avatar Peter Leitzen

Fix upcoming RuboCop offenses in Monitor settings feature specs

They are currently auto-disabled by RuboCop due to the high amount of
offenses. This will change soon.
parent 5f2e02e7
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Projects > Settings > For a forked project', :js do RSpec.describe 'Projects > Settings > For a forked project', :js do
let_it_be(:project) { create(:project, :repository, create_templates: :issue) } let_it_be(:project) { create(:project, :repository, create_templates: :issue) }
let(:user) { project.owner} let(:user) { project.owner }
before do before do
sign_in(user) sign_in(user)
...@@ -16,7 +16,8 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -16,7 +16,8 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
visit project_path(project) visit project_path(project)
wait_for_requests wait_for_requests
expect(page).to have_selector('.sidebar-sub-level-items a[aria-label="Monitor"]', text: 'Monitor', visible: false) expect(page).to have_selector('.sidebar-sub-level-items a[aria-label="Monitor"]',
text: 'Monitor', visible: :hidden)
end end
end end
...@@ -71,10 +72,10 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -71,10 +72,10 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
end end
end end
context 'error tracking settings form' do describe 'error tracking settings form' do
let(:sentry_list_projects_url) { 'http://sentry.example.com/api/0/projects/' } let(:sentry_list_projects_url) { 'http://sentry.example.com/api/0/projects/' }
context 'success path' do context 'when project dropdown is loaded' do
let(:projects_sample_response) do let(:projects_sample_response) do
Gitlab::Utils.deep_indifferent_access( Gitlab::Utils.deep_indifferent_access(
Gitlab::Json.parse(fixture_file('sentry/list_projects_sample_response.json')) Gitlab::Json.parse(fixture_file('sentry/list_projects_sample_response.json'))
...@@ -121,7 +122,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -121,7 +122,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
end end
end end
context 'project dropdown fails to load' do context 'when project dropdown fails to load' do
before do before do
WebMock.stub_request(:get, sentry_list_projects_url) WebMock.stub_request(:get, sentry_list_projects_url)
.to_return( .to_return(
...@@ -151,7 +152,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -151,7 +152,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
end end
end end
context 'integrated error tracking backend' do context 'with integrated error tracking backend' do
it 'successfully fills and submits the form' do it 'successfully fills and submits the form' do
visit project_settings_operations_path(project) visit project_settings_operations_path(project)
...@@ -185,7 +186,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do ...@@ -185,7 +186,7 @@ RSpec.describe 'Projects > Settings > For a forked project', :js do
end end
end end
context 'grafana integration settings form' do describe 'grafana integration settings form' do
it 'successfully fills and completes the form' do it 'successfully fills and completes the form' do
visit project_settings_operations_path(project) visit project_settings_operations_path(project)
......
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