Index: journal.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/journal/journal.install,v
retrieving revision 1.7
diff -u -p -r1.7 journal.install
--- journal.install	3 Nov 2008 23:17:50 -0000	1.7
+++ journal.install	17 Jun 2009 02:07:03 -0000
@@ -2,6 +2,11 @@
 // $Id: journal.install,v 1.7 2008/11/03 23:17:50 sun Exp $
 
 /**
+ * @file
+ * journal.install for the journal module
+ */
+
+/**
  * Implementation of hook_schema().
  */
 function journal_schema() {
Index: journal.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/journal/journal.module,v
retrieving revision 1.18
diff -u -p -r1.18 journal.module
--- journal.module	5 Jun 2009 16:30:23 -0000	1.18
+++ journal.module	17 Jun 2009 02:07:03 -0000
@@ -122,6 +122,7 @@ function journal_form_alter(&$form, &$fo
   
   $form['journal'] = array(
     '#weight' => $journal_weight,
+    '#tree' => FALSE,
   );
 
   // Store the path on which this form was initially displayed.
@@ -239,7 +240,7 @@ function journal_block($op = 'list', $de
   }
   else if ($op == 'view' && user_access('access journal')) {
     $block = array();
-    switch($delta) {
+    switch ($delta) {
       case 'backlog':
         $result = db_query("SELECT j.*, u.name FROM {journal} j INNER JOIN {users} u ON j.uid = u.uid WHERE j.location = '%s' ORDER BY j.timestamp DESC", $_GET['q']);
         if ($output = journal_output($result, 'list')) {
@@ -296,7 +297,7 @@ function journal_view() {
 function journal_output($journal, $format = 'table', $header = array()) {
   switch ($format) {
     case 'text':
-      // Output delimiter in first line, since this may chance.
+      // Output delimiter in first line, since this may change.
       $output = '\t' . "\n";
       
       while ($entry = (is_array($journal) ? array_shift($journal) : db_fetch_object($journal))) {
Index: journal.test
===================================================================
RCS file: journal.test
diff -N journal.test
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ journal.test	17 Jun 2009 02:07:03 -0000
@@ -0,0 +1,60 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Simpletest integration for the Journal module
+ */
+class JournalTestCase extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+     'name' => t('Journal module functionality'),
+     'description' => t('Test the Journal module functionality.'),
+     'group' => t('Journal'),
+    );
+  }
+
+  function setUp() {
+    parent::setUp('journal');
+
+    $user = $this->drupalCreateUser(array('administer blocks', 'access journal'));
+    $this->drupalLogin($user);
+  }
+
+  /** 
+   * Test a basic journal entry.
+   */
+  function testJournalAddEntry() {
+    // Add a new block.
+    $title = $this->randomName(8);
+    $description = $this->randomName(8);
+    $journal_entry = $this->randomName(8);
+    $edit = array(
+      'info' => $description,
+      'title' => $title,
+      'body' => $this->randomName(8),
+      'pages' => '',
+      'journal_entry' => $journal_entry,
+    );
+    $this->drupalPost('admin/build/block/add', $edit, 'Save block');
+
+    // Make sure the journal entry we added above is in the journal report.
+    $this->drupalGet(url('admin/reports/journal', array('absolute' => TRUE)));
+    $this->assertText($journal_entry, t('Verify that the journal entry is listed'));
+    $this->assertText('admin/build/block/add', t('Verify that the journal entry location is listed'));
+
+    // Position the new block adding a journal entry.
+    $journal_entry = $this->randomName(8);
+    $edit = array(
+      'journal_backlog[region]' => 'right',
+      'journal_entry' => $journal_entry,
+    );
+    $this->drupalPost('admin/build/block', $edit, 'Save blocks');
+
+    // Verify the entry is in the journal report.
+    $this->drupalGet(url('admin/reports/journal', array('absolute' => TRUE)));
+    $this->assertText($journal_entry, t('Verify that the journal entry is listed'));
+    $this->assertText('admin/build/block', t('Verify that the journal entry location is listed'));
+  }
+}
+
