aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-13 16:01:20 +0800
committerGitHub <noreply@github.com>2021-02-13 16:01:20 +0800
commit6a1495dc98f5ae5f89de58ed0ff0b500fc71ff5a (patch)
tree60cc46ed16a3d84b654cce4b3f364f5eccce52b0 /BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs
parentc3d0a5f88de0fbdf6bc584548832017087ab1248 (diff)
parentfd5f842e807ecf0d3a4c385fd0e5e3a52b0a79b2 (diff)
downloadtimeline-6a1495dc98f5ae5f89de58ed0ff0b500fc71ff5a.tar.gz
timeline-6a1495dc98f5ae5f89de58ed0ff0b500fc71ff5a.tar.bz2
timeline-6a1495dc98f5ae5f89de58ed0ff0b500fc71ff5a.zip
Merge pull request #273 from crupest/backend
User permission related field in http.
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs20
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();
+ }
+ }
}
}