Adds notes, return false if the file is not actually deleted, adds test assertions
This commit is contained in:
@@ -49,7 +49,10 @@ namespace Umbraco.Core.Models
|
|||||||
return path
|
return path
|
||||||
.Replace('\\', System.IO.Path.DirectorySeparatorChar)
|
.Replace('\\', System.IO.Path.DirectorySeparatorChar)
|
||||||
.Replace('/', System.IO.Path.DirectorySeparatorChar);
|
.Replace('/', System.IO.Path.DirectorySeparatorChar);
|
||||||
//.TrimStart(System.IO.Path.DirectorySeparatorChar);
|
|
||||||
|
//Don't strip the start - this was a bug fixed in 7.3, see ScriptRepositoryTests.PathTests
|
||||||
|
//.TrimStart(System.IO.Path.DirectorySeparatorChar)
|
||||||
|
//.TrimStart('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -868,7 +868,7 @@ namespace Umbraco.Core.Services
|
|||||||
if (partialView == null)
|
if (partialView == null)
|
||||||
{
|
{
|
||||||
uow.Commit();
|
uow.Commit();
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uow.Events.DispatchCancelable(DeletingPartialView, this, new DeleteEventArgs<IPartialView>(partialView)))
|
if (uow.Events.DispatchCancelable(DeletingPartialView, this, new DeleteEventArgs<IPartialView>(partialView)))
|
||||||
|
|||||||
@@ -237,6 +237,14 @@ namespace Umbraco.Tests.Persistence.Repositories
|
|||||||
Assert.AreEqual("test-path-1.js", script.Path);
|
Assert.AreEqual("test-path-1.js", script.Path);
|
||||||
Assert.AreEqual("/scripts/test-path-1.js", script.VirtualPath);
|
Assert.AreEqual("/scripts/test-path-1.js", script.VirtualPath);
|
||||||
|
|
||||||
|
//ensure you can prefix the same path as the root path name
|
||||||
|
script = new Script("scripts/path-2/test-path-2.js") { Content = "// script" };
|
||||||
|
repository.AddOrUpdate(script);
|
||||||
|
unitOfWork.Commit();
|
||||||
|
Assert.IsTrue(_fileSystem.FileExists("scripts/path-2/test-path-2.js"));
|
||||||
|
Assert.AreEqual("scripts\\path-2\\test-path-2.js", script.Path);
|
||||||
|
Assert.AreEqual("/scripts/scripts/path-2/test-path-2.js", script.VirtualPath);
|
||||||
|
|
||||||
script = new Script("path-2/test-path-2.js") { Content = "// script" };
|
script = new Script("path-2/test-path-2.js") { Content = "// script" };
|
||||||
repository.AddOrUpdate(script);
|
repository.AddOrUpdate(script);
|
||||||
unitOfWork.Commit();
|
unitOfWork.Commit();
|
||||||
|
|||||||
Reference in New Issue
Block a user