mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
Fixing unit tests
--HG-- branch : 1.x
This commit is contained in:
@@ -121,6 +121,9 @@ namespace Orchard.Tests.Modules.Users.Controllers {
|
||||
_controller = _container.Resolve<AccountController>();
|
||||
|
||||
var mockHttpContext = new Mock<HttpContextBase>();
|
||||
mockHttpContext.SetupGet(x => x.Request.Url).Returns(new Uri("http://www.orchardproject.net"));
|
||||
mockHttpContext.SetupGet(x => x.Request).Returns(new HttpRequestStub());
|
||||
|
||||
_controller.ControllerContext = new ControllerContext(
|
||||
mockHttpContext.Object,
|
||||
new RouteData(
|
||||
@@ -353,6 +356,12 @@ namespace Orchard.Tests.Modules.Users.Controllers {
|
||||
return nv;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ApplicationPath {
|
||||
get {
|
||||
return "/";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -199,7 +199,12 @@ namespace Orchard.Users.Controllers {
|
||||
return View();
|
||||
}
|
||||
|
||||
_userService.SendLostPasswordEmail(username, nonce => Url.AbsoluteAction(() => Url.Action("LostPassword", "Account", new { Area = "Orchard.Users", nonce = nonce })));
|
||||
var siteUrl = _orchardServices.WorkContext.CurrentSite.As<SiteSettings2Part>().BaseUrl;
|
||||
if (String.IsNullOrWhiteSpace(siteUrl)) {
|
||||
siteUrl = HttpContext.Request.ToRootUrlString();
|
||||
}
|
||||
|
||||
_userService.SendLostPasswordEmail(username, nonce => Url.MakeAbsolute(Url.Action("LostPassword", "Account", new { Area = "Orchard.Users", nonce = nonce }), siteUrl));
|
||||
|
||||
_orchardServices.Notifier.Information(T("Check your e-mail for the confirmation link."));
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ namespace Orchard.Mvc.Extensions {
|
||||
baseUrl = urlHelper.RequestContext.HttpContext.Request.ToRootUrlString();
|
||||
}
|
||||
|
||||
if(String.IsNullOrEmpty(url)) {
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
// remove any application path from the base url
|
||||
var applicationPath = urlHelper.RequestContext.HttpContext.Request.ApplicationPath;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user