<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -48,11 +48,17 @@ function _8cpj_by_forks() {
 function _8cpj_completed() {
 }
 
-$(&quot;#repo-sorts&quot;).html(&quot;Sort by: &lt;a id='sort-by-last-commit' href='javascript:_8cpj_by_commit();'&gt;last commit&lt;/a&gt;, &quot; +
-  &quot;&lt;a id='sort-by-issues' href='javascript:_8cpj_by_issues();'&gt;issues&lt;/a&gt;, &quot; +
-  &quot;&lt;a id='sort-by-forks' href='javascript:_8cpj_by_forks();'&gt;forks&lt;/a&gt;, &quot;+
-  &quot;&lt;a id='sort-by-watchers' href='javascript:_8cpj_by_watchers();'&gt;watchers&lt;/a&gt;&quot;);
+function _8cpj_insert_sort_links() {
+  $(&quot;#repo-sorts&quot;).html(&quot;Sort by: &lt;a id='sort-by-last-commit' href='javascript:_8cpj_by_commit();'&gt;last commit&lt;/a&gt;, &quot; +
+    &quot;&lt;a id='sort-by-issues' href='javascript:_8cpj_by_issues();'&gt;issues&lt;/a&gt;, &quot; +
+    &quot;&lt;a id='sort-by-forks' href='javascript:_8cpj_by_forks();'&gt;forks&lt;/a&gt;, &quot;+
+    &quot;&lt;a id='sort-by-watchers' href='javascript:_8cpj_by_watchers();'&gt;watchers&lt;/a&gt;&quot;);
+};
 
-if (typeof _8cpj_version != 'undefined' &amp;&amp; _8cpj_version != '1.1') {
-  $(&quot;#repo-sorts&quot;).prepend(&quot;&lt;div id='update8cpj'&gt;&lt;strong&gt;Hey!&lt;/strong&gt; &lt;a href='http://whytheluckystiff.net/greasy/the-octocats-pajamas.user.js'&gt;An update&lt;/a&gt; for The Octocat's Pajamas (1.2)&lt;/div&gt;&quot;);
+if (!_8cpj_am_running_tests()) {
+  _8cpj_insert_sort_links();
+
+  if (typeof _8cpj_version != 'undefined' &amp;&amp; _8cpj_version != '1.1') {
+    $(&quot;#repo-sorts&quot;).prepend(&quot;&lt;div id='update8cpj'&gt;&lt;strong&gt;Hey!&lt;/strong&gt; &lt;a href='http://whytheluckystiff.net/greasy/the-octocats-pajamas.user.js'&gt;An update&lt;/a&gt; for The Octocat's Pajamas (1.2)&lt;/div&gt;&quot;);
+  }
 }</diff>
      <filename>src/the-octocats-pajamas.js</filename>
    </modified>
    <modified>
      <diff>@@ -400,7 +400,7 @@
           // get_network(repo);
         });
 
-        if (!am_running_tests()) {
+        if (!_8cpj_am_running_tests()) {
           load_latest_pajamas();
         }
       }
@@ -436,10 +436,6 @@
     head.appendChild(style);
   };
   
-  var am_running_tests = function() {
-    return document['__running_tests'];
-  };
-
   /*
    * timeago: a jQuery plugin, version: 0.7.1 (2009-02-18)
    * @requires jQuery v1.2 or later
@@ -566,10 +562,14 @@
     }
   }
 
-  if (!am_running_tests()) {
+  if (!_8cpj_am_running_tests()) {
     wear_blue_and_white_pajamas();
   }
 
   until_we_re_ready();
 
 })();
+
+function _8cpj_am_running_tests() {
+  return document['__running_tests'];
+};</diff>
      <filename>src/the-octocats-pajamas.user.js</filename>
    </modified>
    <modified>
      <diff>@@ -8,24 +8,6 @@
     &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
     &lt;script src=&quot;../assets/jsunittest.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
     &lt;script src=&quot;../assets/jshoulda.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
-    &lt;script type=&quot;text/javascript&quot;&gt;
-// &lt;![CDATA[
-    document['__running_tests'] = true;
-
-    // Stub out values expected from github via GM's unsafeWindow
-    window.unsafeWindow = window;
-    window.github_user = 'why';
-    
-    // stubbing out greasemonkey's AJAX call for the moment
-    var GM_xmlhttpRequest = function() {
-
-    };
-    // ]]&gt;
-    &lt;/script&gt;
-    &lt;script src=&quot;../../src/the-octocats-pajamas.user.js&quot; type=&quot;text/javascript&quot;&gt;
-&lt;/script&gt;
-    &lt;script src=&quot;../../src/the-octocats-pajamas.js&quot; type=&quot;text/javascript&quot;&gt;
-&lt;/script&gt;
     &lt;link rel=&quot;stylesheet&quot; href=&quot;../assets/github.css&quot; type=&quot;text/css&quot; /&gt;
     &lt;link rel=&quot;stylesheet&quot; href=&quot;../../src/the-octocats-pajamas.css&quot; type=&quot;text/css&quot; /&gt;
     &lt;link rel=&quot;stylesheet&quot; href=&quot;../assets/unittest.css&quot; type=&quot;text/css&quot; /&gt;
@@ -150,6 +132,12 @@
               &lt;li class=&quot;public source&quot;&gt;
                 &lt;img alt=&quot;public&quot; src=&quot;/images/icons/public.png&quot; /&gt; &lt;b&gt;&lt;a href=&quot;/why/8cpj/tree&quot;&gt;8cpj&lt;/a&gt;&lt;/b&gt;
               &lt;/li&gt;
+              &lt;li class=&quot;public source&quot;&gt;
+                &lt;img alt=&quot;public&quot; src=&quot;/images/icons/public.png&quot; /&gt; &lt;b&gt;&lt;a href=&quot;/why/hpricot/tree&quot;&gt;hpricot&lt;/a&gt;&lt;/b&gt;
+              &lt;/li&gt;
+              &lt;li class=&quot;public source&quot;&gt;
+                &lt;img alt=&quot;public&quot; src=&quot;/images/icons/public.png&quot; /&gt; &lt;b&gt;&lt;a href=&quot;/why/potion/tree&quot;&gt;potion&lt;/a&gt;&lt;/b&gt;
+              &lt;/li&gt;
             &lt;/ul&gt;
           &lt;/div&gt;
           &lt;div class=&quot;repos watching&quot;&gt;
@@ -172,15 +160,52 @@
         &lt;/div&gt;
       &lt;/div&gt;
     &lt;/div&gt;
+    
+    &lt;script type=&quot;text/javascript&quot;&gt;
+    // &lt;![CDATA[
+      document['__running_tests'] = true;
+
+      // Stub out values expected from github via GM's unsafeWindow
+      window.unsafeWindow = window;
+      window.github_user = 'why';
+    
+      // stubbing out greasemonkey's AJAX call for the moment
+      var GM_xmlhttpRequest = function() {
+
+      };
+    // ]]&gt;
+    &lt;/script&gt;
+    
+    &lt;!-- greasemonkey loads .user.js script after DOM is ready; so load these after div#sample --&gt;
+    &lt;script src=&quot;../../src/the-octocats-pajamas.user.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
+    &lt;script src=&quot;../../src/the-octocats-pajamas.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
+    
     &lt;script type=&quot;text/javascript&quot;&gt;
 // &lt;![CDATA[
 
-context(&quot;Homepage&quot;, {
+context(&quot;Initial home page&quot;, {
   setup: function() {
+  }},
+  should(&quot;display place holder for sort-by bar&quot;, function() {
+    this.assertEqual(&quot;The Octocat's Pajamas are buttoning...&quot;, $('#repo-sorts').html());
+  }),
+  should(&quot;know user is 'why'&quot;, function() {
+    this.assertEqual('why', $.user);
+  })
+)();
 
+context(&quot;After data loaded&quot;, {
+  setup: function() {
+    _8cpj_insert_sort_links();
   }},
-  should(&quot;run tests&quot;, function() {
-    this.assert(true);
+  should(&quot;not display place holder for sort-by bar&quot;, function() {
+    this.assertNotEqual(&quot;The Octocat's Pajamas are buttoning...&quot;, $('#repo-sorts').html());
+  }),
+  should(&quot;have sort-by links&quot;, function() {
+    this.assertVisible('sort-by-last-commit');
+    this.assertVisible('sort-by-issues');
+    this.assertVisible('sort-by-forks');
+    this.assertVisible('sort-by-watchers');
   })
 )();
 // ]]&gt;</diff>
      <filename>test/unit/homepage_test.html</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>tasks/deploy.rake</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>3edfcd3e6a29085bdaf352d242a7e51cabc9dbe3</id>
    </parent>
  </parents>
  <author>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </author>
  <url>http://github.com/drnic/8cpj/commit/56065aadf5b5653495e77c1f708783ace5619ac5</url>
  <id>56065aadf5b5653495e77c1f708783ace5619ac5</id>
  <committed-date>2009-04-23T03:51:16-07:00</committed-date>
  <authored-date>2009-04-23T03:51:16-07:00</authored-date>
  <message>some simple tests for before/after the helper file is loaded</message>
  <tree>754137ffd208f782c2885d1c59f2e662a92de9d9</tree>
  <committer>
    <name>Dr Nic Williams</name>
    <email>drnicwilliams@gmail.com</email>
  </committer>
</commit>
