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

chore[Op#57989]: use consistent naming with existing methods

Kabiru Mwenjaf0f8bf247a23
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 4f7d8f98ffe..9057b15def0 100644
--- a/modules/storages/spec/features/storages/admin/project_storages_spec.rb
+++ b/modules/storages/spec/features/storages/admin/project_storages_spec.rb
@@ -230,7 +230,7 @@ RSpec.describe "Admin lists project mappings for a storage",
expect(page).to have_text(subproject.name)
aggregate_failures "pagination links maintain the correct url" do
- project_storages_index_page.expect_correct_pagination_options(model: storage)
+ project_storages_index_page.expect_page_sizes(model: storage)
end
end
@@ -303,7 +303,7 @@ RSpec.describe "Admin lists project mappings for a storage",
end
aggregate_failures "pagination links maintain the correct url" do
- project_storages_index_page.expect_correct_pagination_options(model: storage)
+ project_storages_index_page.expect_page_sizes(model: storage)
end
end
@@ -405,7 +405,7 @@ RSpec.describe "Admin lists project mappings for a storage",
expect(page).to have_no_text(project.name)
aggregate_failures "pagination links maintain the correct url" do
- project_storages_index_page.expect_correct_pagination_links(model: storage, current_page:)
+ project_storages_index_page.expect_page_links(model: storage, current_page:)
end
end
end
diff --git a/spec/features/admin/custom_fields/custom_fields_project_spec.rb b/spec/features/admin/custom_fields/custom_fields_project_spec.rb
index a12a4d90181..7726caf0d32 100644
--- a/spec/features/admin/custom_fields/custom_fields_project_spec.rb
+++ b/spec/features/admin/custom_fields/custom_fields_project_spec.rb
@@ -115,7 +115,7 @@ RSpec.describe "Custom Fields Multi-Project Activation", :js do
expect(page).to have_text(subproject.name)
aggregate_failures "pagination links maintain the correct url" do
- custom_field_projects_page.expect_correct_pagination_options(model: custom_field)
+ custom_field_projects_page.expect_page_sizes(model: custom_field)
end
end
@@ -132,7 +132,7 @@ RSpec.describe "Custom Fields Multi-Project Activation", :js do
expect(page).to have_no_text(project.name)
aggregate_failures "pagination links maintain the correct url after unlinking is done" do
- custom_field_projects_page.expect_correct_pagination_links(model: custom_field, current_page:)
+ custom_field_projects_page.expect_page_links(model: custom_field, current_page:)
custom_field_projects_page.expect_current_page_number(current_page)
end
end
diff --git a/spec/features/admin/project_custom_fields/project_mappings_spec.rb b/spec/features/admin/project_custom_fields/project_mappings_spec.rb
index 880222955d4..97769b0e80a 100644
--- a/spec/features/admin/project_custom_fields/project_mappings_spec.rb
+++ b/spec/features/admin/project_custom_fields/project_mappings_spec.rb
@@ -119,7 +119,7 @@ RSpec.describe "Project Custom Field Mappings", :js do
expect(page).to have_text(subproject.name)
aggregate_failures "pagination links maintain the correct url" do
- project_custom_field_mappings_page.expect_correct_pagination_options(model: project_custom_field)
+ project_custom_field_mappings_page.expect_page_sizes(model: project_custom_field)
end
end
@@ -136,7 +136,7 @@ RSpec.describe "Project Custom Field Mappings", :js do
expect(page).to have_no_text(project.name)
aggregate_failures "pagination links maintain the correct url after unlinking is done" do
- project_custom_field_mappings_page.expect_correct_pagination_links(model: project_custom_field, current_page:)
+ project_custom_field_mappings_page.expect_page_links(model: project_custom_field, current_page:)
project_custom_field_mappings_page.expect_current_page_number(current_page)
end
end
diff --git a/spec/support/pages/projects/index.rb b/spec/support/pages/projects/index.rb
index 8a2fe2aa999..d83f6f04ac4 100644
--- a/spec/support/pages/projects/index.rb
+++ b/spec/support/pages/projects/index.rb
@@ -127,7 +127,7 @@ module Pages
end
end
- def expect_correct_pagination_links(model:, current_page: 1)
+ def expect_page_links(model:, current_page: 1)
within ".op-pagination--pages" do
pagination_links = page.all(".op-pagination--item-link")
expect(pagination_links.size).to be_positive
@@ -147,10 +147,11 @@ module Pages
end
end
- def expect_correct_pagination_options(model:)
+ def expect_page_sizes(model:)
within ".op-pagination--options" do
pagination_links = page.all(".op-pagination--item-link")
expect(pagination_links.size).to be_positive
+ expect(page).to have_css(".op-pagination--item_current")
pagination_links.each do |pagination_link|
uri = URI.parse(pagination_link["href"])