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

Remove unused properties of not found example

Oliver Günther94e2d812010b
diff --git a/modules/budgets/spec/requests/api/v3/budgets/budget_resource_spec.rb b/modules/budgets/spec/requests/api/v3/budgets/budget_resource_spec.rb
index 500b1693c36..6b312e48ca1 100644
--- a/modules/budgets/spec/requests/api/v3/budgets/budget_resource_spec.rb
+++ b/modules/budgets/spec/requests/api/v3/budgets/budget_resource_spec.rb
@@ -100,7 +100,7 @@ describe 'API v3 Budget resource' do
get get_path
end
- it_behaves_like 'not found', 'User'
+ it_behaves_like 'not found'
end
end
end
diff --git a/modules/costs/spec/requests/api/cost_types/cost_type_resource_spec.rb b/modules/costs/spec/requests/api/cost_types/cost_type_resource_spec.rb
index 3ac47630144..2962e551994 100644
--- a/modules/costs/spec/requests/api/cost_types/cost_type_resource_spec.rb
+++ b/modules/costs/spec/requests/api/cost_types/cost_type_resource_spec.rb
@@ -61,9 +61,7 @@ describe 'API v3 Cost Type resource' do
context 'cost type deleted' do
let!(:cost_type) { FactoryBot.create(:cost_type, :deleted) }
- it_behaves_like 'not found', 'Cost type' do
- let(:id) { cost_type.id }
- end
+ it_behaves_like 'not found'
end
context 'invalid id' do
diff --git a/spec/features/work_packages/navigation_spec.rb b/spec/features/work_packages/navigation_spec.rb
index fd9401911db..19d1d942829 100644
--- a/spec/features/work_packages/navigation_spec.rb
+++ b/spec/features/work_packages/navigation_spec.rb
@@ -150,7 +150,7 @@ RSpec.feature 'Work package navigation', js: true, selenium: true do
page404.expect_notification type: :error, message: I18n.t(:notice_file_not_found)
visit "/projects/#{project.identifier}/work_packages/999999999"
- page404.expect_and_dismiss_notification type: :error, message: I18n.t('api_v3.errors.code_404')
+ page404.expect_and_dismiss_notification type: :error, message: I18n.t('api_v3.errors.not_found.work_package')
end
# Regression #29994
diff --git a/spec/requests/api/v3/activities_api_spec.rb b/spec/requests/api/v3/activities_api_spec.rb
index a56a694b42b..51066473165 100644
--- a/spec/requests/api/v3/activities_api_spec.rb
+++ b/spec/requests/api/v3/activities_api_spec.rb
@@ -169,10 +169,7 @@ describe API::V3::Activities::ActivitiesAPI, type: :request, content_type: :json
context 'requesting nonexistent activity' do
let(:get_path) { api_v3_paths.activity 9999 }
- it_behaves_like 'not found' do
- let(:id) { 9999 }
- let(:type) { 'Journal' }
- end
+ it_behaves_like 'not found'
end
context 'without sufficient permissions' do
diff --git a/spec/requests/api/v3/attachments/attachment_resource_shared_examples.rb b/spec/requests/api/v3/attachments/attachment_resource_shared_examples.rb
index 2fa069e857a..c98cacec997 100644
--- a/spec/requests/api/v3/attachments/attachment_resource_shared_examples.rb
+++ b/spec/requests/api/v3/attachments/attachment_resource_shared_examples.rb
@@ -216,19 +216,14 @@ shared_examples 'an APIv3 attachment resource', type: :request, content_type: :j
context 'requesting nonexistent attachment' do
let(:get_path) { api_v3_paths.attachment 9999 }
- it_behaves_like 'not found' do
- let(:id) { 9999 }
- let(:type) { 'Attachment' }
- end
+ it_behaves_like 'not found'
end
context 'requesting attachments without sufficient permissions' do
let(:current_user) { missing_permissions_user }
let(:permissions) { all_permissions - Array(read_permission) }
- it_behaves_like 'not found' do
- let(:type) { 'Attachment' }
- end
+ it_behaves_like 'not found'
end
end
end
@@ -367,10 +362,7 @@ shared_examples 'an APIv3 attachment resource', type: :request, content_type: :j
context 'for a non-existent attachment' do
let(:path) { api_v3_paths.attachment 1337 }
- it_behaves_like 'not found' do
- let(:id) { 1337 }
- let(:type) { 'Attachment' }
- end
+ it_behaves_like 'not found'
end
end
diff --git a/spec/requests/api/v3/category_resource_spec.rb b/spec/requests/api/v3/category_resource_spec.rb
index e78f7db0bd7..5fc2fdc119f 100644
--- a/spec/requests/api/v3/category_resource_spec.rb
+++ b/spec/requests/api/v3/category_resource_spec.rb
@@ -74,10 +74,7 @@ describe 'API v3 Category resource' do
get get_path
end
- it_behaves_like 'not found' do
- let(:id) { private_project.id.to_s }
- let(:type) { 'Project' }
- end
+ it_behaves_like 'not found'
end
end
diff --git a/spec/requests/api/v3/groups/group_resource_spec.rb b/spec/requests/api/v3/groups/group_resource_spec.rb
index b7905460734..98b4ba78713 100644
--- a/spec/requests/api/v3/groups/group_resource_spec.rb
+++ b/spec/requests/api/v3/groups/group_resource_spec.rb
@@ -88,10 +88,7 @@ describe 'API v3 Group resource', type: :request, content_type: :json do
context 'requesting nonexistent group' do
let(:get_path) { api_v3_paths.group 9999 }
- it_behaves_like 'not found' do
- let(:id) { 9999 }
- let(:type) { 'Group' }
- end
+ it_behaves_like 'not found'
end
context 'not having the necessary permission to see any group' do
@@ -380,10 +377,7 @@ describe 'API v3 Group resource', type: :request, content_type: :json do
context 'for a non-existent group' do
let(:path) { api_v3_paths.group 11111337 }
- it_behaves_like 'not found' do
- let(:id) { 11111337 }
- let(:type) { 'Group' }
- end
+ it_behaves_like 'not found'
end
end
diff --git a/spec/requests/api/v3/help_texts/help_texts_resource_spec.rb b/spec/requests/api/v3/help_texts/help_texts_resource_spec.rb
index 35dbdae1240..a3b96909759 100644
--- a/spec/requests/api/v3/help_texts/help_texts_resource_spec.rb
+++ b/spec/requests/api/v3/help_texts/help_texts_resource_spec.rb
@@ -103,10 +103,7 @@ describe 'API v3 Help texts resource' do
# cf not visible to the user
let(:help_text) { help_texts.last }
- it_behaves_like 'not found' do
- let(:id) { help_text.id }
- let(:type) { 'HelpText' }
- end
+ it_behaves_like 'not found'
end
end
end
diff --git a/spec/requests/api/v3/membership_resources_spec.rb b/spec/requests/api/v3/membership_resources_spec.rb
index 7a1d28b6a74..d4dc7f77b01 100644
--- a/spec/requests/api/v3/membership_resources_spec.rb
+++ b/spec/requests/api/v3/membership_resources_spec.rb
@@ -959,10 +959,7 @@ describe 'API v3 memberships resource', type: :request, content_type: :json do
context 'if lacking the view permissions' do
let(:permissions) { [] }
- it_behaves_like 'not found' do
- let(:id) { member.id }
- let(:type) { 'Membership' }
- end
+ it_behaves_like 'not found'
end
end
@@ -993,10 +990,7 @@ describe 'API v3 memberships resource', type: :request, content_type: :json do
context 'for a non-existent version' do
let(:path) { api_v3_paths.membership 1337 }
- it_behaves_like 'not found' do
- let(:id) { 1337 }
- let(:type) { 'Membership' }
- end
+ it_behaves_like 'not found'
end
end
diff --git a/spec/requests/api/v3/placeholder_users/delete_resource_examples.rb b/spec/requests/api/v3/placeholder_users/delete_resource_examples.rb
index cfcacfbf052..6908bd6063f 100644
--- a/spec/requests/api/v3/placeholder_users/delete_resource_examples.rb
+++ b/spec/requests/api/v3/placeholder_users/delete_resource_examples.rb
@@ -43,10 +43,7 @@ shared_examples 'deletion allowed' do
context 'with a non-existent user' do
let(:path) { api_v3_paths.placeholder_user 1337 }
- it_behaves_like 'not found' do
- let(:id) { 1337 }
- let(:type) { 'PlaceholderUser' }
- end
+ it_behaves_like 'not found'
end
end
diff --git a/spec/requests/api/v3/project_resource_spec.rb b/spec/requests/api/v3/project_resource_spec.rb
index c487b710eb7..aa781c9abc0 100644
--- a/spec/requests/api/v3/project_resource_spec.rb
+++ b/spec/requests/api/v3/project_resource_spec.rb
@@ -123,10 +123,7 @@ describe 'API v3 Project resource', type: :request, content_type: :json do
response
end
- it_behaves_like 'not found' do
- let(:id) { 9999 }
- let(:type) { 'Project' }
- end
+ it_behaves_like 'not found'
end
context 'requesting project without sufficient permissions' do
@@ -136,10 +133,7 @@ describe 'API v3 Project resource', type: :request, content_type: :json do
response
end
- it_behaves_like 'not found' do
- let(:id) { another_project.id.to_s }
- let(:type) { 'Project' }
- end
+ it_behaves_like 'not found'
end
context 'not being allowed to see the parent project' do
@@ -883,10 +877,7 @@ describe 'API v3 Project resource', type: :request, content_type: :json do
context 'for a non-existent project' do
let(:path) { api_v3_paths.project 0 }
- it_behaves_like 'not found' do
- let(:id) { 0 }
- let(:type) { 'Project' }
- end
+ it_behaves_like 'not found'
end
context 'for a project which has a version foreign work packages refer to' do
diff --git a/spec/requests/api/v3/projects/statuses/project_status_resource_spec.rb b/spec/requests/api/v3/projects/statuses/project_status_resource_spec.rb
index ec4d460d9f0..63bb10363ab 100644
--- a/spec/requests/api/v3/projects/statuses/project_status_resource_spec.rb
+++ b/spec/requests/api/v3/projects/statuses/project_status_resource_spec.rb
@@ -66,10 +66,7 @@ describe 'API v3 Project status resource', type: :request, content_type: :json d
response
end
- it_behaves_like 'not found' do
- let(:id) { 'bogus' }
- let(:type) { 'ProjectStatus' }
- end
+ it_behaves_like 'not found'
end
end
end
diff --git a/spec/requests/api/v3/queries/query_resource_spec.rb b/spec/requests/api/v3/queries/query_resource_spec.rb
index f9fc6ab5007..1c5d4de7519 100644
--- a/spec/requests/api/v3/queries/query_resource_spec.rb
+++ b/spec/requests/api/v3/queries/query_resource_spec.rb
@@ -260,10 +260,7 @@ describe 'API v3 Query resource', type: :request, content_type: :json do
let(:query_id) { 1337 } # could be anything as long as we do not create an actual query
let(:path) { api_v3_paths.query query_id }
- it_behaves_like 'not found' do
- let(:id) { query_id }
- let(:type) { 'Query' }
- end
+ it_behaves_like 'not found'
end
end
@@ -333,10 +330,7 @@ describe 'API v3 Query resource', type: :request, content_type: :json do
context 'when trying to star nonexistent query' do
let(:star_path) { api_v3_paths.query_star 999 }
- it_behaves_like 'not found' do
- let(:id) { 999 }
- let(:type) { 'Query' }
- end
+ it_behaves_like 'not found'
end
end
@@ -423,10 +417,7 @@ describe 'API v3 Query resource', type: :request, content_type: :json do
patch unstar_path
end
- it_behaves_like 'not found' do
- let(:id) { 999 }
- let(:type) { 'Query' }
- end
+ it_behaves_like 'not found'
end
end
diff --git a/spec/requests/api/v3/user/user_resource_spec.rb b/spec/requests/api/v3/user/user_resource_spec.rb
index 52ad82e48ae..0171ae3943f 100644
--- a/spec/requests/api/v3/user/user_resource_spec.rb
+++ b/spec/requests/api/v3/user/user_resource_spec.rb
@@ -197,10 +197,7 @@ describe 'API v3 User resource',
context 'requesting nonexistent user' do
let(:get_path) { api_v3_paths.user 9999 }
- it_behaves_like 'not found' do
- let(:id) { 9999 }
- let(:type) { 'User' }
- end
+ it_behaves_like 'not found'
end
context 'requesting current user' do
@@ -259,10 +256,7 @@ describe 'API v3 User resource',
context 'with a non-existent user' do
let(:path) { api_v3_paths.user 1337 }
- it_behaves_like 'not found' do
- let(:id) { 1337 }
- let(:type) { 'User' }
- end
+ it_behaves_like 'not found'
end
end
diff --git a/spec/requests/api/v3/user/userlock_resource_spec.rb b/spec/requests/api/v3/user/userlock_resource_spec.rb
index ee8875eb1ee..99e6f1c4887 100644
--- a/spec/requests/api/v3/user/userlock_resource_spec.rb
+++ b/spec/requests/api/v3/user/userlock_resource_spec.rb
@@ -74,10 +74,7 @@ describe 'API v3 UserLock resource', type: :request, content_type: :json do
context 'requesting nonexistent user' do
let(:lock_path) { api_v3_paths.user_lock 9999 }
- it_behaves_like 'not found' do
- let(:id) { 9999 }
- let(:type) { 'User' }
- end
+ it_behaves_like 'not found'
end
context 'non-admin user' do
diff --git a/spec/requests/api/v3/version_resource_spec.rb b/spec/requests/api/v3/version_resource_spec.rb
index 9cc52021d42..6e9b63effc6 100644
--- a/spec/requests/api/v3/version_resource_spec.rb
+++ b/spec/requests/api/v3/version_resource_spec.rb
@@ -113,10 +113,7 @@ describe 'API v3 Version resource', content_type: :json do
get get_path
end
- it_behaves_like 'not found' do
- let(:id) { version_in_project.id }
- let(:type) { 'Version' }
- end
+ it_behaves_like 'not found'
end
end
@@ -248,10 +245,7 @@ describe 'API v3 Version resource', content_type: :json do
context 'if lacking the manage permissions' do
let(:permissions) { [] }
- it_behaves_like 'not found' do
- let(:id) { version.id }
- let(:type) { 'Version' }
- end
+ it_behaves_like 'not found'
end
context 'if having the manage permission in a different project' do
@@ -455,10 +449,7 @@ describe 'API v3 Version resource', content_type: :json do
context 'for a non-existent version' do
let(:path) { api_v3_paths.version 1337 }
- it_behaves_like 'not found' do
- let(:id) { 1337 }
- let(:type) { 'Version' }
- end
+ it_behaves_like 'not found'
end
end