diff options
author | crupest <crupest@outlook.com> | 2021-02-13 15:09:21 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-02-13 15:09:21 +0800 |
commit | d45f776470a7cece565a46655f286fcb06cb3a87 (patch) | |
tree | 4ec318115f600889037340ec630579cb8c405c11 /BackEnd/Timeline.Tests | |
parent | 99d525560f6aefa5f5fb63e3ba2fff3b557d61f6 (diff) | |
download | timeline-d45f776470a7cece565a46655f286fcb06cb3a87.tar.gz timeline-d45f776470a7cece565a46655f286fcb06cb3a87.tar.bz2 timeline-d45f776470a7cece565a46655f286fcb06cb3a87.zip |
feat: Post info add editable field.
Diffstat (limited to 'BackEnd/Timeline.Tests')
-rw-r--r-- | BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs | 20 |
1 files changed, 20 insertions, 0 deletions
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<HttpTimelinePost>($"timelines/{generator(1)}/posts", CreateTextPostRequest("a"));
+
+ post.Editable.Should().BeTrue();
+ }
+
+ {
+ using var client = await CreateClientAs(2);
+ var post2 = await client.TestGetAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts/{post.Id}");
+ post2.Editable.Should().BeFalse();
+ }
+ }
}
}
|