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

[#55968] Improve spec

Judith Roth6afe20184626
diff --git a/modules/storages/spec/features/storages/admin/project_storages_spec.rb b/modules/storages/spec/features/storages/admin/project_storages_spec.rb
index 30ba376a4c8..3b3dda5ff9c 100644
--- a/modules/storages/spec/features/storages/admin/project_storages_spec.rb
+++ b/modules/storages/spec/features/storages/admin/project_storages_spec.rb
@@ -106,10 +106,14 @@ RSpec.describe "Admin lists project mappings for a storage",
end
end
- aggregate_failures "shows the correct project mappings including archived projects and their folder modes" do
+ aggregate_failures "shows the correct project mappings including archived projects and their configured folder modes" do
within "#project-table" do
- expect(page).to have_text(project.name.to_s).and have_text("Automatically managed")
- expect(page).to have_text("ARCHIVED #{archived_project.name}").and have_text("No specific folder")
+ project_storages_index_page.within_the_table_row_containing(project.name) do
+ expect(page).to have_text("Automatically managed")
+ end
+ project_storages_index_page.within_the_table_row_containing(archived_project.name) do
+ expect(page).to have_text("No specific folder")
+ end
end
end
end
diff --git a/modules/storages/spec/support/pages/admin/storages/project_storages/project_storages_index.rb b/modules/storages/spec/support/pages/admin/storages/project_storages/project_storages_index.rb
index 754cdb63b2e..aa1c58714cd 100644
--- a/modules/storages/spec/support/pages/admin/storages/project_storages/project_storages_index.rb
+++ b/modules/storages/spec/support/pages/admin/storages/project_storages/project_storages_index.rb
@@ -36,6 +36,12 @@ module Pages
def path
"/admin/settings/storages/#{storage.id}/project_storages"
end
+
+ def within_the_table_row_containing(text, &block)
+ within(:xpath, "//td[contains(.,'#{text}')]/..") do
+ yield block
+ end
+ end
end
end
end