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

Run `rubocop -a` on spec/features

Aaron Contreras9b75ea6f9058
diff --git a/spec/features/admin/attachments/quarantined_attachments_spec.rb b/spec/features/admin/attachments/quarantined_attachments_spec.rb
index e0058c993aa..898b457a1d5 100644
--- a/spec/features/admin/attachments/quarantined_attachments_spec.rb
+++ b/spec/features/admin/attachments/quarantined_attachments_spec.rb
@@ -61,7 +61,7 @@ RSpec.describe 'Quarantined attachments', :js, :with_cuprite do
expect { quarantined_attachment.reload }.to raise_error(ActiveRecord::RecordNotFound)
end
- expect(page).not_to have_text 'other-1.txt'
+ expect(page).to have_no_text 'other-1.txt'
expect(page).to have_text 'other-2.txt'
end
end
diff --git a/spec/features/custom_fields/multi_user_custom_field_spec.rb b/spec/features/custom_fields/multi_user_custom_field_spec.rb
index bf1a63f0731..c9a2b283d26 100644
--- a/spec/features/custom_fields/multi_user_custom_field_spec.rb
+++ b/spec/features/custom_fields/multi_user_custom_field_spec.rb
@@ -4,6 +4,7 @@ require "support/pages/work_packages/abstract_work_package"
RSpec.describe "multi select custom values", :js, :with_cuprite do
shared_let(:admin) { create(:admin) }
let(:current_user) { admin }
+ let(:wp_page) { Pages::FullWorkPackage.new work_package }
let(:cf_edit_field) do
field = wp_page.edit_field custom_field.attribute_name(:camel_case)
field.field_type = 'create-autocompleter'
@@ -25,8 +26,6 @@ RSpec.describe "multi select custom values", :js, :with_cuprite do
)
end
- let(:wp_page) { Pages::FullWorkPackage.new work_package }
-
before do
login_as current_user
wp_page.visit!
diff --git a/spec/features/projects/modules_spec.rb b/spec/features/projects/modules_spec.rb
index f1952488686..c4177c545c5 100644
--- a/spec/features/projects/modules_spec.rb
+++ b/spec/features/projects/modules_spec.rb
@@ -50,7 +50,7 @@ RSpec.describe 'Projects module administration' do
expect(page).to have_unchecked_field 'Time and costs'
expect(page).to have_unchecked_field 'Work packages'
- expect(page).not_to have_xpath(project_work_packages_menu_link_selector, visible: false)
+ expect(page).to have_no_xpath(project_work_packages_menu_link_selector)
check 'Activity'
click_button 'Save'
@@ -71,7 +71,7 @@ RSpec.describe 'Projects module administration' do
dependency: 'Work packages',
module: 'Calendars')
- expect(page).not_to have_xpath(project_work_packages_menu_link_selector, visible: false)
+ expect(page).to have_no_xpath(project_work_packages_menu_link_selector)
check 'Work packages'
click_button 'Save'
@@ -83,12 +83,12 @@ RSpec.describe 'Projects module administration' do
expect(page).to have_unchecked_field 'Time and costs'
expect(page).to have_checked_field 'Work packages'
- expect(page).to have_xpath(project_work_packages_menu_link_selector, visible: false)
+ expect(page).to have_xpath(project_work_packages_menu_link_selector, visible: :all)
uncheck 'Work packages'
click_button 'Save'
- expect(page).not_to have_xpath(project_work_packages_menu_link_selector, visible: false)
+ expect(page).to have_no_xpath(project_work_packages_menu_link_selector)
end
context 'with a user who does not have the correct permissions (#38097)' do
diff --git a/spec/features/projects/projects_index_spec.rb b/spec/features/projects/projects_index_spec.rb
index 0009b06932d..b2f27c2cccb 100644
--- a/spec/features/projects/projects_index_spec.rb
+++ b/spec/features/projects/projects_index_spec.rb
@@ -316,7 +316,7 @@ RSpec.describe 'Projects index page',
# The same filters should still be intact but the order should be DESC on name
projects_page.expect_projects_listed(public_project)
- projects_page.expect_projects_not_listed(project, # Filtered out
+ projects_page.expect_projects_not_listed(project, # Filtered out
development_project) # Present on page 2
projects_page.expect_total_pages(2) # Filters kept active, so there is no third page.
diff --git a/spec/features/work_packages/display_representations/switch_display_representations_on_mobile_spec.rb b/spec/features/work_packages/display_representations/switch_display_representations_on_mobile_spec.rb
index 4af5b111db8..12c5fd59a2f 100644
--- a/spec/features/work_packages/display_representations/switch_display_representations_on_mobile_spec.rb
+++ b/spec/features/work_packages/display_representations/switch_display_representations_on_mobile_spec.rb
@@ -36,11 +36,11 @@ RSpec.describe 'Switching work package view on mobile', :js do
let(:wp_1) do
create(:work_package,
- project:,)
+ project:)
end
let(:wp_2) do
create(:work_package,
- project:,)
+ project:)
end
before do
diff --git a/spec/features/work_packages/edit_on_change_work_package_status_permission_spec.rb b/spec/features/work_packages/edit_on_change_work_package_status_permission_spec.rb
index 7e3870cdb21..194f8c9e6b0 100644
--- a/spec/features/work_packages/edit_on_change_work_package_status_permission_spec.rb
+++ b/spec/features/work_packages/edit_on_change_work_package_status_permission_spec.rb
@@ -37,7 +37,7 @@ RSpec.describe 'edit work package', :js do
member_with_roles: { project => role })
end
let(:permissions) { %i[view_work_packages change_work_package_status] }
- let(:role) { create(:project_role, permissions: permissions) }
+ let(:role) { create(:project_role, permissions:) }
let(:type) { create(:type) }
let(:project) { create(:project, types: [type]) }
@@ -48,7 +48,7 @@ RSpec.describe 'edit work package', :js do
type_id: type.id,
old_status: status_new,
new_status: status_done,
- role: role)
+ role:)
end
let(:work_package) do
create(:work_package,
diff --git a/spec/features/work_packages/share/share_spec.rb b/spec/features/work_packages/share/share_spec.rb
index 1683655ce62..68e6797c63d 100644
--- a/spec/features/work_packages/share/share_spec.rb
+++ b/spec/features/work_packages/share/share_spec.rb
@@ -81,7 +81,6 @@ RSpec.describe 'Work package sharing',
let(:columns) { Components::WorkPackages::Columns.new }
let(:wp_modal) { Components::WorkPackages::TableConfigurationModal.new }
-
current_user { create(:user, firstname: 'Signed in', lastname: 'User') }
def shared_principals
@@ -304,7 +303,6 @@ RSpec.describe 'Work package sharing',
columns.add 'Shared with', save_changes: false
columns.apply
-
wp_row = wp_table.row(work_package)
expect(wp_row).to have_css('.wp-table--cell-td.sharedWithUsers .badge', text: '7')
wp_row.find('.wp-table--cell-td.sharedWithUsers .badge').click
diff --git a/spec/features/work_packages/sorting/manual_sorting_spec.rb b/spec/features/work_packages/sorting/manual_sorting_spec.rb
index fb613bab13e..385c9c17d6d 100644
--- a/spec/features/work_packages/sorting/manual_sorting_spec.rb
+++ b/spec/features/work_packages/sorting/manual_sorting_spec.rb
@@ -403,7 +403,6 @@ RSpec.describe 'Manual sorting of WP table', :js do
query
end
-
it 'reloads after drop' do
wp_timeline.visit_query(query_tl)
wp_timeline.expect_timeline!