Skip to content

Commit

Permalink
Added test case for checking if existing scripts (jQuery, Backbone, U…
Browse files Browse the repository at this point in the history
…nderscore) are altered/overwritten by profiler
  • Loading branch information
ToshB committed Jan 7, 2013
1 parent 1c23532 commit 1f77623
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
24 changes: 24 additions & 0 deletions Samples/Raven.Sample.MvcIntegration/Views/Home/Index.cshtml
Expand Up @@ -13,6 +13,30 @@
</div> </div>


<script src="@Url.Content("~/Scripts/jquery.min.js")"></script> <script src="@Url.Content("~/Scripts/jquery.min.js")"></script>

<script>
$.originalVersion = true;
Backbone = { originalVersion: true };
_ = { originalVersion: true };
</script>

@Raven.Client.MvcIntegration.RavenProfiler.CurrentRequestSessions()

<script>
function checkScripts() {
if ($.originalVersion && Backbone.originalVersion && _.originalVersion) {
console.log('original scripts unchanged');
} else {
alert('Original scripts overwritten by profiler');
}
}
checkScripts();
$(function() {
checkScripts();
});
</script>

<script> <script>
$('#singleGet').on('click', function() { $('#singleGet').on('click', function() {
$.getJSON('@Url.Action("SingleSessionGet", "Home")'); $.getJSON('@Url.Action("SingleSessionGet", "Home")');
Expand Down
Expand Up @@ -6,7 +6,6 @@
<title>@ViewBag.Title</title> <title>@ViewBag.Title</title>
<link href="~/Content/bootstrap.css" rel="stylesheet" /> <link href="~/Content/bootstrap.css" rel="stylesheet" />
<link href="~/Content/Site.css" rel="stylesheet" /> <link href="~/Content/Site.css" rel="stylesheet" />
@Raven.Client.MvcIntegration.RavenProfiler.CurrentRequestSessions()
</head> </head>
<body> <body>
@RenderBody() @RenderBody()
Expand Down

0 comments on commit 1f77623

Please sign in to comment.