summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Read <tread@gitlab.com>2018-12-13 16:55:43 +0100
committerPeter Leitzen <pleitzen@gitlab.com>2019-01-02 15:29:32 +0100
commitc2fa4ecadb75bd441ac85a59e6e25de0df31c478 (patch)
treedd4b06c5a0fbcd0e7d9493e8521814390119b937
parent146aa8b7e823a0a06bfd95c6fb82235803177447 (diff)
downloadgitlab-ce-c2fa4ecadb75bd441ac85a59e6e25de0df31c478.tar.gz
Add view and feature test for error tracking settings
-rw-r--r--app/views/projects/settings/operations/show.html.haml1
-rw-r--r--spec/features/projects/settings/operations_settings_spec.rb44
-rw-r--r--spec/views/projects/settings/operations/show.html.haml_spec.rb24
3 files changed, 68 insertions, 1 deletions
diff --git a/app/views/projects/settings/operations/show.html.haml b/app/views/projects/settings/operations/show.html.haml
index 381e750bbd8..ddc0deb67d4 100644
--- a/app/views/projects/settings/operations/show.html.haml
+++ b/app/views/projects/settings/operations/show.html.haml
@@ -1,5 +1,4 @@
- @content_class = 'limit-container-width' unless fluid_layout
-- page_title _('Operations Settings')
- page_title _('Operations')
- if Feature.enabled?(:error_tracking, @project, default_enabled: true)
diff --git a/spec/features/projects/settings/operations_settings_spec.rb b/spec/features/projects/settings/operations_settings_spec.rb
new file mode 100644
index 00000000000..84992ee92b8
--- /dev/null
+++ b/spec/features/projects/settings/operations_settings_spec.rb
@@ -0,0 +1,44 @@
+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
+
+ page.within '.nav-sidebar' do
+ expect(page).to have_content ('Operations')
+ end
+ end
+ end
+
+ # TODO: Complete this test
+ # 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
+
+ # find.find('qa-settings-item').find(:xpath, 'ancestor:')
+ # page.within('.sidebar-sub-level-items', text:'Settings') do
+ # expect(page).not_to have_content('Operations')
+ # end
+ # end
+ # end
+ end
+end
diff --git a/spec/views/projects/settings/operations/show.html.haml_spec.rb b/spec/views/projects/settings/operations/show.html.haml_spec.rb
new file mode 100644
index 00000000000..78379763ed4
--- /dev/null
+++ b/spec/views/projects/settings/operations/show.html.haml_spec.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require 'rails_helper'
+
+describe 'projects/settings/operations/show' do
+ let(:project) { create(:project, :repository) }
+
+ describe 'Operations > Error Tracking' do
+ before do
+ stub_feature_flags(error_tracking: true)
+ 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 bearer token')
+ expect(rendered).to have_content ('Active')
+ end
+ end
+ end
+end