Fixes unit tests for Umbraco_Route_User_Defined_Controller_Action
This commit is contained in:
@@ -64,7 +64,8 @@ namespace Umbraco.Tests.Routing
|
||||
}
|
||||
|
||||
//test all template name styles to match the ActionName
|
||||
[TestCase("home-page")]
|
||||
[TestCase("home-\\234^^*32page")]
|
||||
[TestCase("home-page")]
|
||||
[TestCase("Home-Page")]
|
||||
[TestCase("HomePage")]
|
||||
[TestCase("homePage")]
|
||||
@@ -84,7 +85,9 @@ namespace Umbraco.Tests.Routing
|
||||
|
||||
handler.GetHandlerForRoute(routingContext.UmbracoContext.HttpContext.Request.RequestContext, docRequest);
|
||||
Assert.AreEqual("CustomDocument", routeData.Values["controller"].ToString());
|
||||
Assert.AreEqual("HomePage", routeData.Values["action"].ToString());
|
||||
Assert.AreEqual(
|
||||
global::umbraco.cms.helpers.Casing.SafeAlias(templateName),
|
||||
routeData.Values["action"].ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace Umbraco.Web.Mvc
|
||||
//the template Alias should always be already saved with a safe name.
|
||||
//if there are hyphens in the name and there is a hijacked route, then the Action will need to be attributed
|
||||
// with the action name attribute.
|
||||
var templateName = publishedContentRequest.Template.Alias.Split('.')[0];
|
||||
var templateName = global::umbraco.cms.helpers.Casing.SafeAlias(publishedContentRequest.Template.Alias.Split('.')[0]);
|
||||
def.ActionName = templateName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user