summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/features/incident_details_routing_shared_examples.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/features/incident_details_routing_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/features/incident_details_routing_shared_examples.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/support/shared_examples/features/incident_details_routing_shared_examples.rb b/spec/support/shared_examples/features/incident_details_routing_shared_examples.rb
new file mode 100644
index 00000000000..dab125caa60
--- /dev/null
+++ b/spec/support/shared_examples/features/incident_details_routing_shared_examples.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'for each incident details route' do |example, tab_text:|
+ before do
+ sign_in(user)
+ visit incident_path
+ end
+
+ context 'for /-/issues/:id route' do
+ let(:incident_path) { project_issue_path(project, incident) }
+
+ before do
+ page.within('[data-testid="incident-tabs"]') { click_link tab_text }
+ end
+
+ it_behaves_like example
+ end
+
+ context 'for /-/issues/incident/:id route' do
+ let(:incident_path) { incident_project_issues_path(project, incident) }
+
+ before do
+ page.within('[data-testid="incident-tabs"]') { click_link tab_text }
+ end
+
+ it_behaves_like example
+ end
+end