[#73887] Add missing test cases for buckets and sprints

This commit is contained in:
Tobias Dillmann
2026-06-10 15:30:02 +02:00
committed by Tobias Dillmann
parent 4e616f88dc
commit 258d17ceb4
2 changed files with 25 additions and 3 deletions
@@ -67,9 +67,11 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter, "rendering" do
current_user { build_stubbed(:user) }
before do
mock_permissions_for(current_user) do |mock|
permissions.each do |permission|
mock.allow_in_project(*permission, project:) if project
if project.present?
mock_permissions_for(current_user) do |mock|
permissions.each do |permission|
mock.allow_in_project(*permission, project:)
end
end
end
end
@@ -119,6 +121,14 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter, "rendering" do
it_behaves_like "has no link"
end
context "when the work package has no backlog bucket assigned" do
let(:sprint) { nil }
it_behaves_like "has an empty link" do
let(:link) { "sprint" }
end
end
end
describe "backlogBucket" do
@@ -179,6 +189,12 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter, "rendering" do
it_behaves_like "has the resource not embedded"
end
context "when the work package has no sprint assigned" do
let(:sprint) { nil }
it_behaves_like "has the resource not embedded"
end
end
describe "backlogBucket" do
@@ -71,5 +71,11 @@ RSpec.describe "API v3 Sprint resource on project", content_type: :json do
it_behaves_like "unauthorized access"
end
context "for a user being not a project member at all" do
let(:get_path) { api_v3_paths.project_sprints(project_without_permission.id) }
it_behaves_like "not found"
end
end
end