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 spec to correctly test for path

Oliver Günther5c15a5a930d6
diff --git a/modules/boards/spec/features/board_navigation_spec.rb b/modules/boards/spec/features/board_navigation_spec.rb
index 3e89b87c079..373ea4072a4 100644
--- a/modules/boards/spec/features/board_navigation_spec.rb
+++ b/modules/boards/spec/features/board_navigation_spec.rb
@@ -172,9 +172,8 @@ describe 'Work Package boards spec', type: :feature, js: true do
# Delete the WP
destroy_modal.expect_listed(wp)
destroy_modal.confirm_deletion
- click_button(I18n.t('button_delete'))
board_page.expect_empty
- expect(page).to have_current_path
+ board_page.expect_path
end
end
diff --git a/modules/boards/spec/features/support/board_page.rb b/modules/boards/spec/features/support/board_page.rb
index aa8877f2e61..dffe566cb5e 100644
--- a/modules/boards/spec/features/support/board_page.rb
+++ b/modules/boards/spec/features/support/board_page.rb
@@ -53,6 +53,10 @@ module Pages
!(free? || action_attribute.nil?)
end
+ def expect_path
+ expect(page).to have_current_path /boards\/#{@board.id}/
+ end
+
def action_attribute
@board.options['attribute']
end
@@ -213,7 +217,7 @@ module Pages
end
def expect_empty
- expect(page).to have_no_selector('.boards-list--item')
+ expect(page).to have_no_selector('.boards-list--item', wait: 10)
end
def remove_list(name)