Fixes issue with the delivery api can find unpublished content
This commit is contained in:
Bjarke Berg
2024-11-04 12:27:47 +01:00
committed by GitHub
parent e4d99747d1
commit 6417948a58
5 changed files with 37 additions and 12 deletions

View File

@@ -83,6 +83,19 @@ public class DocumentHybridCacheTests : UmbracoIntegrationTestWithContentEditing
Assert.IsFalse(textPage.IsPublished());
}
[Test]
public async Task Cannot_get_unpublished_content()
{
// Arrange
var unpublishAttempt = await ContentPublishingService.UnpublishAsync(PublishedTextPage.Key.Value, null, Constants.Security.SuperUserKey);
//Act
var textPage = await PublishedContentHybridCache.GetByIdAsync(PublishedTextPageId, false);
// Assert
Assert.IsNull(textPage);
}
[Test]
public async Task Can_Get_Draft_Of_Published_Content_By_Key()
{