From 01c3c5800f9b8a7b89d98b28ea748d496497c0b2 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 13 Feb 2021 15:09:21 +0800 Subject: feat: Post info add editable field. --- .../IntegratedTests/TimelinePostTest.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'BackEnd/Timeline.Tests/IntegratedTests') diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs index c5ff507f..b91de6c2 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs @@ -566,5 +566,25 @@ namespace Timeline.Tests.IntegratedTests body.Should().Equal(imageData); } } + + [Theory] + [MemberData(nameof(TimelineNameGeneratorTestData))] + public async Task Post_Editable(TimelineNameGenerator generator) + { + HttpTimelinePost post; + + { + using var client = await CreateClientAsUser(); + post = await client.TestPostAsync($"timelines/{generator(1)}/posts", CreateTextPostRequest("a")); + + post.Editable.Should().BeTrue(); + } + + { + using var client = await CreateClientAs(2); + var post2 = await client.TestGetAsync($"timelines/{generator(1)}/posts/{post.Id}"); + post2.Editable.Should().BeFalse(); + } + } } } -- cgit v1.2.3