public void Rebase_EditableImage_FromSite_ToApplication() { item.ImageUrl = "/Upload/hello.jpg"; AppPathRebaser.Rebase(item, "/", "/app/"); Assert.That(item.ImageUrl, Is.EqualTo("/app/Upload/hello.jpg")); }
public void Rebase_EditableUrl_FromSite_ToApplication() { item.SomeUrl = "/hello/world/"; AppPathRebaser.Rebase(item, "/", "/app/"); Assert.That(item.SomeUrl, Is.EqualTo("/app/hello/world/")); }
public void Ignores_TextFields_WhenRebasing_FromApplication_ToSite() { item.Heading = "This is a title"; AppPathRebaser.Rebase(item, "/app/", "/"); Assert.That(item.Heading, Is.EqualTo("This is a title")); }
public void Ignores_NonLinks_WhenRebasing_FromApplication_ToSite() { item.Text = "<p>This is an url: /app/hello/world/</p>"; AppPathRebaser.Rebase(item, "/app/", "/"); Assert.That(item.Text, Is.EqualTo("<p>This is an url: /app/hello/world/</p>")); }
public void Rebase_AnchorWithin_EditableFreeTextArea_FromApplication_ToSite() { item.Text = @"<a href=""/app/hello/world/"">hello</a>"; AppPathRebaser.Rebase(item, "/app/", "/"); Assert.That(item.Text, Is.EqualTo(@"<a href=""/hello/world/"">hello</a>")); }
public void Rebase_ImageWithin_EditableFreeTextArea_FromApplication_ToSite() { item.Text = @"<img src=""/app/Upload/hello.jpg""/>"; AppPathRebaser.Rebase(item, "/app/", "/"); Assert.That(item.Text, Is.EqualTo(@"<img src=""/Upload/hello.jpg""/>")); }
public void Rebase_EditableLink_FromApplication_ToSite() { item.LinkUrl = "/app/hello/world/"; AppPathRebaser.Rebase(item, "/app/", "/"); Assert.That(item.LinkUrl, Is.EqualTo("/hello/world/")); }
public void Rebase_EditableFileUpload_FromApplication_ToSite() { item.FileUrl = "/app/Upload/hello.jpg"; AppPathRebaser.Rebase(item, "/app/", "/"); Assert.That(item.FileUrl, Is.EqualTo("/Upload/hello.jpg")); }
public void ExternalUrl_IsNotRebased() { item.Text = @"<p><a href=""http://n2cms.com/"">hello</a></p>"; AppPathRebaser.Rebase(item, "/", "/app/"); Assert.That(item.Text, Is.EqualTo(@"<p><a href=""http://n2cms.com/"">hello</a></p>")); }
public void NewPath_IsStored_OnRoot() { var root = new RelativityItem(); AppPathRebaser rebaser = GetRebaser(root); rebaser.Rebase("/", "/app/").ToList(); Assert.That(root[InstallationManager.InstallationAppPath], Is.EqualTo("/app/")); }
public void Rebase_ImageWithin_EditableFreeTextArea_InheritedFromBaseClass_FromSite_ToApplication() { item = new InheritsRelativityItem(); item.Text = @"<img src=""/Upload/hello.jpg""/>"; AppPathRebaser.Rebase(item, "/", "/app/"); Assert.That(item.Text, Is.EqualTo(@"<img src=""/app/Upload/hello.jpg""/>")); }
public void Rebase_MultipleLinks_InEditableFreeTextArea_FromSite_ToApplication() { item.Text = @"<p><a href=""/hello/"">hello</a></p> <p><a href=""/world/"">hello</a><a href=""/hello/world/"">hello</a></p>"; AppPathRebaser.Rebase(item, "/", "/app/"); Assert.That(item.Text, Is.EqualTo(@"<p><a href=""/app/hello/"">hello</a></p> <p><a href=""/app/world/"">hello</a><a href=""/app/hello/world/"">hello</a></p>")); }
public void AllItems_AreRebased() { var root = new RelativityItem(); AppPathRebaser rebaser = GetRebaser(root); root.ImageUrl = "/upload/hello.jpg"; item.ImageUrl = "/upload/hello.jpg"; rebaser.Rebase("/", "/app/").ToList(); Assert.That(root.ImageUrl, Is.EqualTo("/app/upload/hello.jpg")); Assert.That(item.ImageUrl, Is.EqualTo("/app/upload/hello.jpg")); }