From 379fca0a4374b779952bc9d3353985d76c82b5f0 Mon Sep 17 00:00:00 2001 From: Renaud Paquay Date: Wed, 14 Jul 2010 12:43:14 -0700 Subject: [PATCH] Fix Unit Tests --HG-- branch : dev --- .../Common/Services/RoutableServiceTests.cs | 2 ++ src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs b/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs index c33b53dda..8e1676a86 100644 --- a/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs +++ b/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs @@ -10,6 +10,7 @@ using Orchard.ContentManagement.Handlers; using Orchard.ContentManagement.MetaData; using Orchard.ContentManagement.Records; using Orchard.Core.Common.Models; +using Orchard.Core.Routable; using Orchard.Core.Routable.Handlers; using Orchard.Core.Routable.Models; using Orchard.Core.Routable.Services; @@ -35,6 +36,7 @@ namespace Orchard.Core.Tests.Common.Services { builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType().As(); + builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterInstance(new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData()))).As(); diff --git a/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs b/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs index 3c475aa04..7ea971dd4 100644 --- a/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs +++ b/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs @@ -12,7 +12,10 @@ namespace Orchard.Core.Routable.Handlers { _routablePathConstraint = routablePathConstraint; Filters.Add(StorageFilter.For(repository)); - OnPublished((context, routable) => _routablePathConstraint.AddPath(routable.Path)); + OnPublished((context, routable) => { + if (!string.IsNullOrEmpty(routable.Path)) + _routablePathConstraint.AddPath(routable.Path); + }); } } public class IsRoutableHandler : ContentHandlerBase {