public void LinkifyGlobalWorks() { ForAllGits(git => { var repo_id = ITH.CreateRepositoryOnWebInterface(RepositoryName); ITH.SetGlobalSetting(m => m.LinksRegex, @"#(\d)(\d+)"); ITH.SetGlobalSetting(m => m.LinksUrl, @"http://some.url/{0}{1}{2}"); app.NavigateTo <RepositoryController>(c => c.Edit(repo_id)); var form = app.FindFormFor <RepositoryDetailModel>(); ITH.SetCheckbox(form.Field(f => f.LinksUseGlobal).Field, true); form.Submit(); CloneEmptyRepositoryWithCredentials(git); CreateIdentity(git); CreateAndAddTestFiles(git, 1); RunGitOnRepo(git, "push origin master").ExpectSuccess(); app.NavigateTo <RepositoryController>(c => c.Commits(repo_id, null, 1)); var display = app.FindDisplayFor <RepositoryCommitsModel>(); var links = app.Browser.FindElementsByCssSelector("a.linkified"); foreach (var link in links) { Assert.AreEqual("http://some.url/#12341234", link.GetAttribute("href")); } ITH.DeleteRepositoryUsingWebsite(repo_id); }); }
private Guid CreateRepositoryOnWebInterface() { app.NavigateTo <RepositoryController>(c => c.Create()); app.FindFormFor <RepositoryDetailModel>() .Field(f => f.Name).SetValueTo("Integration") .Submit(); // ensure it appears on the listing app.NavigateTo <RepositoryController>(c => c.Index(null, null)); var rpm = app.FindDisplayFor <IEnumerable <RepositoryDetailModel> >(); //var l_to = app.FindLinkTo<RepositoryController>(c => c.Detail(Guid.NewGuid())); var repo_item = rpm.DisplayFor(s => s.First().Name); Assert.AreEqual(repo_item.Text, "Integration"); return(new Guid(repo_item.GetAttribute("data-repo-id"))); }