summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/features_visibility_spec.rb11
-rw-r--r--spec/lib/banzai/reference_parser/external_issue_parser_spec.rb12
2 files changed, 22 insertions, 1 deletions
diff --git a/spec/features/projects/features_visibility_spec.rb b/spec/features/projects/features_visibility_spec.rb
index 3bb33394be7..9079350186d 100644
--- a/spec/features/projects/features_visibility_spec.rb
+++ b/spec/features/projects/features_visibility_spec.rb
@@ -42,6 +42,17 @@ describe 'Edit Project Settings', feature: true do
end
end
+ context "When external issue tracker is enabled" do
+ it "does not hide issues tab" do
+ project.project_feature.update(issues_access_level: ProjectFeature::DISABLED)
+ allow_any_instance_of(Project).to receive(:external_issue_tracker).and_return(JiraService.new)
+
+ visit namespace_project_path(project.namespace, project)
+
+ expect(page).to have_selector(".shortcuts-issues")
+ end
+ end
+
context "pipelines subtabs" do
it "shows builds when enabled" do
visit namespace_project_pipelines_path(project.namespace, project)
diff --git a/spec/lib/banzai/reference_parser/external_issue_parser_spec.rb b/spec/lib/banzai/reference_parser/external_issue_parser_spec.rb
index 50a5d1a19ba..0af36776a54 100644
--- a/spec/lib/banzai/reference_parser/external_issue_parser_spec.rb
+++ b/spec/lib/banzai/reference_parser/external_issue_parser_spec.rb
@@ -12,7 +12,17 @@ describe Banzai::ReferenceParser::ExternalIssueParser, lib: true do
context 'when the link has a data-issue attribute' do
before { link['data-external-issue'] = 123 }
- it_behaves_like "referenced feature visibility", "issues"
+ levels = [ProjectFeature::DISABLED, ProjectFeature::PRIVATE, ProjectFeature::ENABLED]
+
+ levels.each do |level|
+ it "creates reference when the feature is #{level}" do
+ project.project_feature.update(issues_access_level: level)
+
+ visible_nodes = subject.nodes_visible_to_user(user, [link])
+
+ expect(visible_nodes).to include(link)
+ end
+ end
end
end