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

Fix flaky spec

Christophe Bliard2a25d89c5e28
diff --git a/spec/features/projects/project_custom_fields/overview_page/dialog/attribute_help_texts_spec.rb b/spec/features/projects/project_custom_fields/overview_page/dialog/attribute_help_texts_spec.rb
index d5c4ec6060c..95139db2666 100644
--- a/spec/features/projects/project_custom_fields/overview_page/dialog/attribute_help_texts_spec.rb
+++ b/spec/features/projects/project_custom_fields/overview_page/dialog/attribute_help_texts_spec.rb
@@ -118,12 +118,12 @@ RSpec.describe "Edit project custom fields on project overview page", "attribute
expect(page).to have_text "Attribute help text"
expect(page).to have_heading "Attachments"
- expect(page).to have_list_item count: 2
- expect(page).to have_list_item text: "file-1.test"
- expect(page).to have_list_item text: "file-2.test"
+ expect(page).to have_list_item count: attachments.count
+ expect(page).to have_list_item text: attachments.first.filename
+ expect(page).to have_list_item text: attachments.second.filename
attachment_window = window_opened_by do
- click_on "file-1.test"
+ click_on attachments.first.filename
end
within_window(attachment_window) do
expect(page).to have_current_path api_v3_paths.attachment_content(attachments.first.id)