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

Make test faster by doing more in one go

Christophe Bliarde5cebf0e477e
diff --git a/spec/features/projects/projects_index_spec.rb b/spec/features/projects/projects_index_spec.rb
index c690ffc8360..1fcb4bf8920 100644
--- a/spec/features/projects/projects_index_spec.rb
+++ b/spec/features/projects/projects_index_spec.rb
@@ -1025,7 +1025,7 @@ describe 'Projects index page',
project_with_activity_enabled.save
end
- it 'is displayed' do
+ it 'is displayed and redirects to project activity page with only project attributes visible' do
login_as(simple_member)
visit projects_path
@@ -1036,21 +1036,14 @@ describe 'Projects index page',
page.find('tbody tr').hover
expect(page).to have_selector('.icon-show-more-horizontal')
- # Test visibility of 'more' menu list items
+ # "Project activity" item should be displayed in the 'more' menu
page.find('tbody tr .icon-show-more-horizontal').click
- menu = page.find('tbody tr .project-actions')
+ menu = page.find('tbody tr .project-actions')
expect(menu).to have_text(I18n.t(:label_project_activity))
- end
- it 'redirects to project activity page with only project attributes visible' do
- login_as(simple_member)
- visit projects_path
-
- page.find('tbody tr').hover
- page.find('tbody tr .icon-show-more-horizontal').click
-
- menu = page.find('tbody tr .project-actions')
+ # Clicking the menu item should redirect to project activity page
+ # with only project attributes displayed
menu.find_link(text: I18n.t(:label_project_activity)).click
expect(page).to have_current_path(project_activity_index_path(project_with_activity_enabled), ignore_query: true)