From bf630bbebafbd4b20d70260c766809b942183633 Mon Sep 17 00:00:00 2001 From: Klaus Zanders Date: Wed, 20 Sep 2023 16:21:02 +0200 Subject: [PATCH] Refactor tests to use new interface for user factory #3 --- spec/features/members/invitation_spec.rb | 3 +-- spec/features/menu_items/menu_permissions_spec.rb | 3 +-- spec/features/notifications/navigation_spec.rb | 3 +-- .../notifications/notification_center/split_screen_spec.rb | 3 +-- spec/features/versions/edit_spec.rb | 3 +-- spec/features/versions/project_settings_index_spec.rb | 3 +-- spec/features/wiki/attachment_upload_spec.rb | 3 +-- spec/features/work_packages/bulk/copy_work_package_spec.rb | 3 +-- .../details/inplace_editor/version_editor_spec.rb | 6 ++---- .../table/baseline/baseline_invisible_project_spec.rb | 3 +-- .../work_packages/table/baseline/baseline_query_spec.rb | 6 ++---- .../work_packages/table/baseline/baseline_rendering_spec.rb | 6 ++---- .../work_packages/table/queries/bool_cf_filter_spec.rb | 3 +-- .../work_packages/table/queries/filter_pagination_spec.rb | 3 +-- .../capability_sql_representer_rendering_spec.rb | 6 ++---- spec/models/journable/with_historic_attributes_spec.rb | 3 +-- spec/models/query/results_cf_sorting_integration_spec.rb | 3 +-- spec/models/query/results_filter_on_historic_data_spec.rb | 3 +-- spec/models/query/results_sort_intergration_spec.rb | 3 +-- .../models/query/results_subject_filter_integration_spec.rb | 3 +-- spec/models/query/results_version_integration_spec.rb | 3 +-- spec/models/watcher_spec.rb | 3 +-- .../pdf_export/work_package_list_to_pdf_spec.rb | 3 +-- .../work_packages/pdf_export/work_package_to_pdf_spec.rb | 3 +-- spec/requests/api/v3/capability_resource_spec.rb | 3 +-- spec/requests/api/v3/notifications/details_resource_spec.rb | 3 +-- spec/requests/api/v3/notifications/index_resource_spec.rb | 3 +-- .../requests/api/v3/notifications/read_ian_resource_spec.rb | 3 +-- .../api/v3/projects/copy/copy_form_resource_spec.rb | 3 +-- spec/requests/api/v3/projects/copy/copy_resource_spec.rb | 3 +-- spec/requests/auth/token_based_access_spec.rb | 3 +-- .../attachments/prepare_upload_service_integration_spec.rb | 3 +-- spec/support/shared/acts_as_attachable.rb | 3 +-- .../work_packages/exports/export_job_integration_spec.rb | 3 +-- 34 files changed, 38 insertions(+), 76 deletions(-) diff --git a/spec/features/members/invitation_spec.rb b/spec/features/members/invitation_spec.rb index da5f4a8342df..8f695f92c610 100644 --- a/spec/features/members/invitation_spec.rb +++ b/spec/features/members/invitation_spec.rb @@ -38,8 +38,7 @@ current_user do create(:user, global_permissions: [:create_user], - member_in_project: project, - member_with_permissions: %i[view_members manage_members]) + member_with_permissions: { project => %i[view_members manage_members] }) end context 'with a new user' do diff --git a/spec/features/menu_items/menu_permissions_spec.rb b/spec/features/menu_items/menu_permissions_spec.rb index f4df3a1cf7ae..5c3bca610d48 100644 --- a/spec/features/menu_items/menu_permissions_spec.rb +++ b/spec/features/menu_items/menu_permissions_spec.rb @@ -33,8 +33,7 @@ with_cuprite: true do let(:user) do create(:user, - member_in_project: project, - member_with_permissions: %i[manage_versions view_work_packages]) + member_with_permissions: { project => %i[manage_versions view_work_packages] }) end let(:admin) { create(:admin) } diff --git a/spec/features/notifications/navigation_spec.rb b/spec/features/notifications/navigation_spec.rb index 4b5a3bbfe38d..95f79afb89d3 100644 --- a/spec/features/notifications/navigation_spec.rb +++ b/spec/features/notifications/navigation_spec.rb @@ -7,8 +7,7 @@ shared_let(:second_work_package) { create(:work_package, project:) } shared_let(:recipient) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_work_packages]) + member_with_permissions: { project => %i[view_work_packages] }) end shared_let(:notification) do create(:notification, diff --git a/spec/features/notifications/notification_center/split_screen_spec.rb b/spec/features/notifications/notification_center/split_screen_spec.rb index 58af25e11846..bf81b4012557 100644 --- a/spec/features/notifications/notification_center/split_screen_spec.rb +++ b/spec/features/notifications/notification_center/split_screen_spec.rb @@ -13,8 +13,7 @@ shared_let(:recipient) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_work_packages]) + member_with_permissions: { project => %i[view_work_packages] }) end shared_let(:notification) do create(:notification, diff --git a/spec/features/versions/edit_spec.rb b/spec/features/versions/edit_spec.rb index f53767befe77..f4c7d2e01d6e 100644 --- a/spec/features/versions/edit_spec.rb +++ b/spec/features/versions/edit_spec.rb @@ -31,8 +31,7 @@ RSpec.describe 'version edit' do let(:user) do create(:user, - member_in_project: version.project, - member_with_permissions: %i[manage_versions view_work_packages]) + member_with_permissions: { version.project => %i[manage_versions view_work_packages] }) end let(:version) { create(:version) } let(:new_version_name) { 'A new version name' } diff --git a/spec/features/versions/project_settings_index_spec.rb b/spec/features/versions/project_settings_index_spec.rb index 1348d1e2654b..b7aac5348ac9 100644 --- a/spec/features/versions/project_settings_index_spec.rb +++ b/spec/features/versions/project_settings_index_spec.rb @@ -31,8 +31,7 @@ RSpec.describe 'project settings index' do let(:user) do create(:user, - member_in_project: project, - member_with_permissions: %i[manage_versions]) + member_with_permissions: { project => %i[manage_versions] }) end let(:project) { create(:project) } let!(:version1) { create(:version, name: "aaaaa 1.", project:) } diff --git a/spec/features/wiki/attachment_upload_spec.rb b/spec/features/wiki/attachment_upload_spec.rb index c46827e238c0..37e855a96b70 100644 --- a/spec/features/wiki/attachment_upload_spec.rb +++ b/spec/features/wiki/attachment_upload_spec.rb @@ -32,8 +32,7 @@ RSpec.describe 'Upload attachment to wiki page', js: true do let(:user) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_wiki_pages edit_wiki_pages]) + member_with_permissions: { project => %i[view_wiki_pages edit_wiki_pages] }) end let(:project) { create(:project) } let(:attachments) { Components::Attachments.new } diff --git a/spec/features/work_packages/bulk/copy_work_package_spec.rb b/spec/features/work_packages/bulk/copy_work_package_spec.rb index 847577ea8d2e..166f4b0111c8 100644 --- a/spec/features/work_packages/bulk/copy_work_package_spec.rb +++ b/spec/features/work_packages/bulk/copy_work_package_spec.rb @@ -15,8 +15,7 @@ create(:user, firstname: 'Dev', lastname: 'Guy', - member_in_project: project, - member_with_permissions: %i[view_work_packages work_package_assigned]) + member_with_permissions: { project => %i[view_work_packages work_package_assigned] }) end shared_let(:mover) do create(:user, diff --git a/spec/features/work_packages/details/inplace_editor/version_editor_spec.rb b/spec/features/work_packages/details/inplace_editor/version_editor_spec.rb index c90f56805991..d482fb0cb3ff 100644 --- a/spec/features/work_packages/details/inplace_editor/version_editor_spec.rb +++ b/spec/features/work_packages/details/inplace_editor/version_editor_spec.rb @@ -41,13 +41,11 @@ let(:work_package) { create(:work_package, project:) } let(:user) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_work_packages edit_work_packages manage_versions assign_versions]) + member_with_permissions: { project => %i[view_work_packages edit_work_packages manage_versions assign_versions] }) end let(:second_user) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_work_packages edit_work_packages assign_versions]) + member_with_permissions: { project => %i[view_work_packages edit_work_packages assign_versions] }) end let(:permissions) { %i[view_work_packages edit_work_packages assign_versions] } let(:work_package_page) { Pages::FullWorkPackage.new(work_package) } diff --git a/spec/features/work_packages/table/baseline/baseline_invisible_project_spec.rb b/spec/features/work_packages/table/baseline/baseline_invisible_project_spec.rb index b3bd2da0fdc0..0ce4c5aa2eaf 100644 --- a/spec/features/work_packages/table/baseline/baseline_invisible_project_spec.rb +++ b/spec/features/work_packages/table/baseline/baseline_invisible_project_spec.rb @@ -39,8 +39,7 @@ create(:user, firstname: 'Itsa', lastname: 'Me', - member_in_project: visible_project, - member_with_permissions: %i[view_work_packages edit_work_packages work_package_assigned assign_versions]) + member_with_permissions: { visible_project => %i[view_work_packages edit_work_packages work_package_assigned assign_versions] }) end shared_let(:wp_bug) do diff --git a/spec/features/work_packages/table/baseline/baseline_query_spec.rb b/spec/features/work_packages/table/baseline/baseline_query_spec.rb index b63bf12cf6f4..8468944e1dbb 100644 --- a/spec/features/work_packages/table/baseline/baseline_query_spec.rb +++ b/spec/features/work_packages/table/baseline/baseline_query_spec.rb @@ -44,15 +44,13 @@ shared_let(:berlin_user) do create(:user, preferences: { time_zone: 'Europe/Berlin' }, - member_in_project: project, - member_with_permissions: %i[view_work_packages save_queries manage_public_queries]) + member_with_permissions: { project => %i[view_work_packages save_queries manage_public_queries] }) end shared_let(:tokyo_user) do create(:user, preferences: { time_zone: 'Asia/Tokyo' }, - member_in_project: project, - member_with_permissions: %i[view_work_packages save_queries manage_public_queries]) + member_with_permissions: { project => %i[view_work_packages save_queries manage_public_queries] }) end it 'shows a warning when an incompatible filter is used' do diff --git a/spec/features/work_packages/table/baseline/baseline_rendering_spec.rb b/spec/features/work_packages/table/baseline/baseline_rendering_spec.rb index d6e88bc981aa..5e3991ddcf80 100644 --- a/spec/features/work_packages/table/baseline/baseline_rendering_spec.rb +++ b/spec/features/work_packages/table/baseline/baseline_rendering_spec.rb @@ -69,16 +69,14 @@ create(:admin, firstname: 'Itsa', lastname: 'Me', - member_in_project: project, - member_with_permissions: %i[view_work_packages edit_work_packages work_package_assigned assign_versions]) + member_with_permissions: { project => %i[view_work_packages edit_work_packages work_package_assigned assign_versions] }) end shared_let(:assignee) do create(:user, firstname: 'Assigned', lastname: 'User', - member_in_project: project, - member_with_permissions: %i[view_work_packages edit_work_packages work_package_assigned]) + member_with_permissions: { project => %i[view_work_packages edit_work_packages work_package_assigned] }) end shared_let(:default_priority) do diff --git a/spec/features/work_packages/table/queries/bool_cf_filter_spec.rb b/spec/features/work_packages/table/queries/bool_cf_filter_spec.rb index 5b6fccedd28d..7e1b870ea53f 100644 --- a/spec/features/work_packages/table/queries/bool_cf_filter_spec.rb +++ b/spec/features/work_packages/table/queries/bool_cf_filter_spec.rb @@ -71,8 +71,7 @@ current_user do create(:user, - member_in_project: project, - member_with_permissions: %i[view_work_packages save_queries]) + member_with_permissions: { project => %i[view_work_packages save_queries] }) end it 'shows the work package matching the bool cf filter' do diff --git a/spec/features/work_packages/table/queries/filter_pagination_spec.rb b/spec/features/work_packages/table/queries/filter_pagination_spec.rb index c8bf5c122469..1833b7ce28ca 100644 --- a/spec/features/work_packages/table/queries/filter_pagination_spec.rb +++ b/spec/features/work_packages/table/queries/filter_pagination_spec.rb @@ -32,8 +32,7 @@ RSpec.describe 'Filter updates pagination', js: true do let(:user) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_work_packages]) + member_with_permissions: { project => %i[view_work_packages] }) end let(:work_packages_page) { WorkPackagesPage.new(project) } diff --git a/spec/lib/api/v3/capabilities/capability_sql_representer_rendering_spec.rb b/spec/lib/api/v3/capabilities/capability_sql_representer_rendering_spec.rb index d9eb28882afb..74d91c7a96e8 100644 --- a/spec/lib/api/v3/capabilities/capability_sql_representer_rendering_spec.rb +++ b/spec/lib/api/v3/capabilities/capability_sql_representer_rendering_spec.rb @@ -40,8 +40,7 @@ end let(:principal) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_members]) + member_with_permissions: { project => %i[view_members] }) end let(:project) do create(:project) @@ -52,8 +51,7 @@ current_user do create(:user, - member_in_project: project, - member_with_permissions: []) + member_with_permissions: { project => [] }) end subject(:json) do diff --git a/spec/models/journable/with_historic_attributes_spec.rb b/spec/models/journable/with_historic_attributes_spec.rb index fbe44903a696..39b0b9168d7a 100644 --- a/spec/models/journable/with_historic_attributes_spec.rb +++ b/spec/models/journable/with_historic_attributes_spec.rb @@ -64,8 +64,7 @@ create(:user, firstname: 'user', lastname: '1', - member_in_project: project, - member_with_permissions: %i[view_work_packages view_file_links]) + member_with_permissions: { project => %i[view_work_packages view_file_links] }) end let(:build_query) do build(:query, user: nil, project: nil).tap do |query| diff --git a/spec/models/query/results_cf_sorting_integration_spec.rb b/spec/models/query/results_cf_sorting_integration_spec.rb index 814adaea4b75..ae3b64361a6c 100644 --- a/spec/models/query/results_cf_sorting_integration_spec.rb +++ b/spec/models/query/results_cf_sorting_integration_spec.rb @@ -36,8 +36,7 @@ create(:user, firstname: 'user', lastname: '1', - member_in_project: project, - member_with_permissions: [:view_work_packages]) + member_with_permissions: { project => [:view_work_packages] }) end let(:type) { create(:type_standard, custom_fields: [custom_field]) } diff --git a/spec/models/query/results_filter_on_historic_data_spec.rb b/spec/models/query/results_filter_on_historic_data_spec.rb index 93118af4a176..ed98d26726ba 100644 --- a/spec/models/query/results_filter_on_historic_data_spec.rb +++ b/spec/models/query/results_filter_on_historic_data_spec.rb @@ -61,8 +61,7 @@ create(:user, firstname: 'user', lastname: '1', - member_in_project: project_with_member, - member_with_permissions: %i[view_work_packages view_file_links]) + member_with_permissions: { project_with_member => %i[view_work_packages view_file_links] }) end def move_work_package_to_project(work_package, project, time) diff --git a/spec/models/query/results_sort_intergration_spec.rb b/spec/models/query/results_sort_intergration_spec.rb index 36dbf26a5e47..9f7c5869867f 100644 --- a/spec/models/query/results_sort_intergration_spec.rb +++ b/spec/models/query/results_sort_intergration_spec.rb @@ -48,8 +48,7 @@ create(:user, firstname: 'user', lastname: '1', - member_in_project: project1, - member_with_permissions: [:view_work_packages]) + member_with_permissions: { project1 => [:view_work_packages] }) end let(:user_a) { create(:user, firstname: 'AAA', lastname: 'AAA') } let(:user_m) { create(:user, firstname: 'mmm', lastname: 'mmm') } diff --git a/spec/models/query/results_subject_filter_integration_spec.rb b/spec/models/query/results_subject_filter_integration_spec.rb index 2bfe7222ecb1..98c35abb81c9 100644 --- a/spec/models/query/results_subject_filter_integration_spec.rb +++ b/spec/models/query/results_subject_filter_integration_spec.rb @@ -37,8 +37,7 @@ create(:user, firstname: 'user', lastname: '1', - member_in_project: project, - member_with_permissions: [:view_work_packages]) + member_with_permissions: { project => [:view_work_packages] }) end let!(:contains_wp) do diff --git a/spec/models/query/results_version_integration_spec.rb b/spec/models/query/results_version_integration_spec.rb index 454aaf22c889..ae7252604e9a 100644 --- a/spec/models/query/results_version_integration_spec.rb +++ b/spec/models/query/results_version_integration_spec.rb @@ -37,8 +37,7 @@ create(:user, firstname: 'user', lastname: '1', - member_in_project: project, - member_with_permissions: [:view_work_packages]) + member_with_permissions: { project => [:view_work_packages] }) end let(:old_version) do diff --git a/spec/models/watcher_spec.rb b/spec/models/watcher_spec.rb index d581e001a694..754654ff9d1b 100644 --- a/spec/models/watcher_spec.rb +++ b/spec/models/watcher_spec.rb @@ -47,8 +47,7 @@ let(:notification_settings) { [] } let(:saved_user) do create(:user, - member_in_project: saved_watchable.project, - member_with_permissions: [], + member_with_permissions: { saved_watchable.project => [] }, notification_settings:) end let(:saved_watchable) { create(:news) } diff --git a/spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb b/spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb index 6f7006a3406a..e81b91d17fa5 100644 --- a/spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb +++ b/spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb @@ -53,8 +53,7 @@ end let(:user) do create(:user, - member_in_project: project, - member_with_permissions: %w[view_work_packages export_work_packages]) + member_with_permissions: { project => %w[view_work_packages export_work_packages] }) end let(:export_time) { DateTime.new(2023, 6, 30, 23, 59) } let(:export_time_formatted) { format_time(export_time, true) } diff --git a/spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb b/spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb index a83109d64dcf..a97174792295 100644 --- a/spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb +++ b/spec/models/work_packages/pdf_export/work_package_to_pdf_spec.rb @@ -35,8 +35,7 @@ let(:project) { create(:project, name: 'Foo Bla. Report No. 4/2021 with/for Case 42', types: [type]) } let(:user) do create(:user, - member_in_project: project, - member_with_permissions: %w[view_work_packages export_work_packages]) + member_with_permissions: { project => %w[view_work_packages export_work_packages] }) end let(:export_time) { DateTime.new(2023, 6, 30, 23, 59) } let(:export_time_formatted) { format_time(export_time, true) } diff --git a/spec/requests/api/v3/capability_resource_spec.rb b/spec/requests/api/v3/capability_resource_spec.rb index 7d029b752f26..5195e1eb5816 100644 --- a/spec/requests/api/v3/capability_resource_spec.rb +++ b/spec/requests/api/v3/capability_resource_spec.rb @@ -38,8 +38,7 @@ shared_let(:project) { create(:project) } shared_current_user do create(:user, - member_in_project: project, - member_with_permissions: %i[manage_members]) + member_with_permissions: { project => %i[manage_members] }) end let(:role) do diff --git a/spec/requests/api/v3/notifications/details_resource_spec.rb b/spec/requests/api/v3/notifications/details_resource_spec.rb index 20bf1bd357f6..1e7219295123 100644 --- a/spec/requests/api/v3/notifications/details_resource_spec.rb +++ b/spec/requests/api/v3/notifications/details_resource_spec.rb @@ -48,8 +48,7 @@ end shared_let(:recipient) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_work_packages]) + member_with_permissions: { project => %i[view_work_packages] }) end let(:notification) { create(:notification, recipient:, resource:, project:, reason:) } diff --git a/spec/requests/api/v3/notifications/index_resource_spec.rb b/spec/requests/api/v3/notifications/index_resource_spec.rb index f7b79190dc07..85ebe5322942 100644 --- a/spec/requests/api/v3/notifications/index_resource_spec.rb +++ b/spec/requests/api/v3/notifications/index_resource_spec.rb @@ -35,8 +35,7 @@ shared_let(:work_package) { create(:work_package) } shared_let(:recipient) do create(:user, - member_in_project: work_package.project, - member_with_permissions: %i[view_work_packages]) + member_with_permissions: { work_package.project => %i[view_work_packages] }) end shared_let(:mentioned_notification) do create(:notification, diff --git a/spec/requests/api/v3/notifications/read_ian_resource_spec.rb b/spec/requests/api/v3/notifications/read_ian_resource_spec.rb index c16fe91eb7c9..d6245bbe52b6 100644 --- a/spec/requests/api/v3/notifications/read_ian_resource_spec.rb +++ b/spec/requests/api/v3/notifications/read_ian_resource_spec.rb @@ -36,8 +36,7 @@ shared_let(:work_package) { create(:work_package, project:) } shared_let(:recipient) do create(:user, - member_in_project: project, - member_with_permissions: %i[view_work_packages]) + member_with_permissions: { project => %i[view_work_packages] }) end shared_let(:notification) do create(:notification, diff --git a/spec/requests/api/v3/projects/copy/copy_form_resource_spec.rb b/spec/requests/api/v3/projects/copy/copy_form_resource_spec.rb index b129d27daa1e..4c5e287111d2 100644 --- a/spec/requests/api/v3/projects/copy/copy_form_resource_spec.rb +++ b/spec/requests/api/v3/projects/copy/copy_form_resource_spec.rb @@ -49,8 +49,7 @@ shared_let(:current_user) do create(:user, - member_in_project: source_project, - member_with_permissions: %i[copy_projects view_project view_work_packages]) + member_with_permissions: { source_project => %i[copy_projects view_project view_work_packages] }) end let(:path) { api_v3_paths.project_copy_form(source_project.id) } diff --git a/spec/requests/api/v3/projects/copy/copy_resource_spec.rb b/spec/requests/api/v3/projects/copy/copy_resource_spec.rb index df1bbf4fee5c..603c885789d5 100644 --- a/spec/requests/api/v3/projects/copy/copy_resource_spec.rb +++ b/spec/requests/api/v3/projects/copy/copy_resource_spec.rb @@ -53,8 +53,7 @@ shared_let(:current_user) do create(:user, - member_in_project: source_project, - member_with_permissions: %i[copy_projects view_project view_work_packages]) + member_with_permissions: { source_project => %i[copy_projects view_project view_work_packages] }) end let(:path) { api_v3_paths.project_copy(source_project.id) } diff --git a/spec/requests/auth/token_based_access_spec.rb b/spec/requests/auth/token_based_access_spec.rb index 9824c1bca2ca..0b09270ae7c7 100644 --- a/spec/requests/auth/token_based_access_spec.rb +++ b/spec/requests/auth/token_based_access_spec.rb @@ -32,8 +32,7 @@ let(:work_package) { create(:work_package) } let(:user) do create(:user, - member_in_project: work_package.project, - member_with_permissions: %i[view_work_packages]) + member_with_permissions: { work_package.project => %i[view_work_packages] }) end let(:rss_key) { user.rss_key } diff --git a/spec/services/attachments/prepare_upload_service_integration_spec.rb b/spec/services/attachments/prepare_upload_service_integration_spec.rb index 3a67a8f563ec..2448f56829ac 100644 --- a/spec/services/attachments/prepare_upload_service_integration_spec.rb +++ b/spec/services/attachments/prepare_upload_service_integration_spec.rb @@ -32,8 +32,7 @@ shared_let(:container) { create(:work_package) } shared_let(:user) do create(:user, - member_in_project: container.project, - member_with_permissions: %i[view_work_packages edit_work_packages]) + member_with_permissions: { container.project => %i[view_work_packages edit_work_packages] }) end let(:instance) { described_class.new(user:) } diff --git a/spec/support/shared/acts_as_attachable.rb b/spec/support/shared/acts_as_attachable.rb index 13d780bb23dd..45609630218e 100644 --- a/spec/support/shared/acts_as_attachable.rb +++ b/spec/support/shared/acts_as_attachable.rb @@ -42,8 +42,7 @@ end let(:no_permission_user) do create(:user, - member_in_project: instance_project, - member_with_permissions: []) + member_with_permissions: { instance_project => [] }) end let(:other_user) do create(:user) diff --git a/spec/workers/work_packages/exports/export_job_integration_spec.rb b/spec/workers/work_packages/exports/export_job_integration_spec.rb index 70b885b288d6..54283be1e7b6 100644 --- a/spec/workers/work_packages/exports/export_job_integration_spec.rb +++ b/spec/workers/work_packages/exports/export_job_integration_spec.rb @@ -32,8 +32,7 @@ let(:project) { create(:project) } let(:user) do create(:user, - member_in_project: project, - member_with_permissions: %w[view_work_packages export_work_packages]) + member_with_permissions: { project => %w[view_work_packages export_work_packages] }) end let(:export) do create(:work_packages_export)