Fix post title generation
This commit is contained in:
parent
c40a7fab26
commit
92e479457c
2 changed files with 13 additions and 1 deletions
|
@ -13,6 +13,17 @@ namespace Website.Tests.Models {
|
|||
post.Url.Should().Be("new-title");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("new:title", "new-title")]
|
||||
[InlineData("new: title", "new-title")]
|
||||
[InlineData("new$title", "new-title")]
|
||||
[InlineData("new TITle", "new-title")]
|
||||
public void UpdateTitle_WithUnsafeCharsInTitle_RegeneratesSafeUrl(string title, string url) {
|
||||
var post = new BlogPost();
|
||||
post.UpdateTitle(title);
|
||||
post.Url.Should().Be(url);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UpdateDraft_WithContent_UpdatesDraftProperty() {
|
||||
var post = new BlogPost();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue