5 test("should provide no conflict", function () {
6 var scrollspy = $.fn.scrollspy.noConflict()
7 ok(!$.fn.scrollspy, 'scrollspy was set back to undefined (org value)')
8 $.fn.scrollspy = scrollspy
11 test("should be defined on jquery object", function () {
12 ok($(document.body).scrollspy, 'scrollspy method is defined')
15 test("should return element", function () {
16 ok($(document.body).scrollspy()[0] == document.body, 'document.body returned')
19 test("should switch active class on scroll", function () {
20 var sectionHTML = '<div id="masthead"></div>'
21 , $section = $(sectionHTML).append('#qunit-fixture')
22 , topbarHTML ='<div class="topbar">'
23 + '<div class="topbar-inner">'
24 + '<div class="container">'
25 + '<h3><a href="#">Bootstrap</a></h3>'
27 + '<li><a href="#masthead">Overview</a></li>'
32 , $topbar = $(topbarHTML).scrollspy()
34 ok($topbar.find('.active', true))