mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
@@ -80,6 +80,22 @@ namespace Orchard.Core.Tests.Routable.Services {
|
||||
Assert.That(thing.Slug, Is.EqualTo("please-do-not-use-any-of-the-following-characters-in-your-slugs"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SpacesSlugShouldBeTreatedAsEmpty() {
|
||||
var contentManager = _container.Resolve<IContentManager>();
|
||||
|
||||
var thing = contentManager.Create<Thing>("thing", t => {
|
||||
t.As<RoutePart>().Record = new RoutePartRecord();
|
||||
t.Title = "My Title";
|
||||
t.Slug = " ";
|
||||
});
|
||||
|
||||
_routableService.FillSlugFromTitle(thing.As<RoutePart>());
|
||||
|
||||
Assert.That(thing.Slug, Is.EqualTo("my-title"));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void SlashInSlugIsAllowed() {
|
||||
Assert.That(_routableService.IsSlugValid("some/page"), Is.True);
|
||||
|
Reference in New Issue
Block a user