Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add test case for searching where the identifer would match but should not be found becasue we are looking for name only

Henriette Darge6200572d0fae
diff --git a/spec/features/projects/project_autocomplete_spec.rb b/spec/features/projects/project_autocomplete_spec.rb
index d14f3e173c9..0e9d6b5f7a6 100644
--- a/spec/features/projects/project_autocomplete_spec.rb
+++ b/spec/features/projects/project_autocomplete_spec.rb
@@ -50,6 +50,12 @@ describe 'Projects autocomplete page', type: :feature, js: true do
parent: project2,
identifier: 'plain-project-2')
end
+ let!(:project4) do
+ create(:project,
+ name: 'Project with different name and identifier',
+ parent: project2,
+ identifier: 'plain-project-4')
+ end
let!(:other_projects) do
names = [
@@ -111,6 +117,14 @@ describe 'Projects autocomplete page', type: :feature, js: true do
top_menu.expect_result 'Plain project'
top_menu.expect_no_result 'Plain other project'
+ # Expect search to match names only and not the identifier
+ top_menu.clear_search
+
+ top_menu.search 'plain'
+ top_menu.expect_result 'Plain project'
+ top_menu.expect_result 'Plain other project'
+ top_menu.expect_no_result 'Project with different name and identifier'
+
# Expect hierarchy
top_menu.clear_search