Example #1
0
        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"));
        }
Example #2
0
        public void Rebase_EditableUrl_FromSite_ToApplication()
        {
            item.SomeUrl = "/hello/world/";

            AppPathRebaser.Rebase(item, "/", "/app/");

            Assert.That(item.SomeUrl, Is.EqualTo("/app/hello/world/"));
        }
Example #3
0
        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"));
        }
Example #4
0
        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>"));
        }
Example #5
0
        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>"));
        }
Example #6
0
        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""/>"));
        }
Example #7
0
        public void Rebase_EditableLink_FromApplication_ToSite()
        {
            item.LinkUrl = "/app/hello/world/";

            AppPathRebaser.Rebase(item, "/app/", "/");

            Assert.That(item.LinkUrl, Is.EqualTo("/hello/world/"));
        }
Example #8
0
        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"));
        }
Example #9
0
        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>"));
        }
Example #10
0
        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/"));
        }
Example #11
0
        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""/>"));
        }
Example #12
0
        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>"));
        }
Example #13
0
        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"));
        }