Fixing some preliminary specflow tests.

--HG--
branch : 1.x
This commit is contained in:
Nathan Heskew
2011-04-08 14:32:05 -07:00
parent 6bf32dbbfb
commit e81f1ed1ba
2 changed files with 7 additions and 2 deletions

View File

@@ -337,7 +337,7 @@ namespace Orchard.Specs.Bindings {
public void WhenIAmRedirected() {
var urlPath = "";
if (Details.ResponseHeaders.TryGetValue("Location", out urlPath)) {
WhenIGoTo(urlPath.Replace("http://127.0.0.1/", ""));
WhenIGoTo(urlPath);
}
else {
Assert.Fail("Expected to be redirected but no Location header returned");

View File

@@ -31,7 +31,12 @@ namespace Orchard.Specs.Hosting {
details.UrlPath = urlPath.Substring(0, queryIndex).Replace('\\', '/');
details.Query = urlPath.Substring(queryIndex + 1);
}
details.Page = (isHomepage ? "" : physicalPath.Combine(details.UrlPath.TrimStart('/', '\\')).GetRelativePath(physicalPath).ToString()).Replace('\\','/');
var physicalFilePath = physicalPath.Combine(details.UrlPath.TrimStart('/', '\\'));
details.Page = (isHomepage ? "" : physicalFilePath.GetRelativePath(physicalPath).ToString());
if (!File.Exists(physicalFilePath))
details.Page = details.Page.Replace('\\', '/');
if (!string.IsNullOrEmpty(webHost.Cookies)) {
details.RequestHeaders.Add("Cookie", webHost.Cookies);